Search Results - CodeGuru Forums
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: OneEyeMan

Page 1 of 23 1 2 3 4

Search: Search took 0.04 seconds.

  1. Replies
    7
    Views
    299

    Re: Is this possible to write like this?

    Hi, D Drmmr,
    Thank you for the suggestion.
    I will wait for Paul's response and then see what is the best option.

    I hope you don't mind this. ;-)

    Thank you.
  2. Replies
    7
    Views
    299

    Re: Is this possible to write like this?

    Hi, Paul,
    Sorry for the late reply. For some reason I didn't get a notification about you post, even though I came to the forum to check zerver' reply.

    Let me give you and idea of what I'm...
  3. Replies
    7
    Views
    299

    Re: Is this possible to write like this?

    Hi, razzle,

    Can I ask you for an example for a bi-directional iterator?
    Never used it before.

    Thank you.
  4. Replies
    7
    Views
    299

    Is this possible to write like this?

    Hi, ALL,
    I'm trying to simplify the writing of the for loop on the std::set.

    This is what I'd like to have:



    for( std::map<std::string,std::set<std::pair<std::string, double> > >::iterator...
  5. Replies
    3
    Views
    244

    Re: Program crashing

    Hi, Philip,

    Thank you.
    Adding:



    else if( lhs.second > rhs.second )
    return false;
  6. Replies
    3
    Views
    244

    [RESOLVED] Program crashing

    Hi, ALL,
    Since I don't know how to remove SOLVED from the thread and this is actually kind of different issue I decided to make a new thread.

    This is a continuation of this thread.

    Thank you...
  7. Re: Define a comparator for std::map

    Thank you zerver.
    If thats what needs to be done...
  8. Re: Define a comparator for std::map

    Thank you, Paul.
    It works.
  9. Re: Define a comparator for std::map

    Hi, guys,
    It still does not compile.
    Here's what I wrote:

    In .h file:


    class Comparator
    {
    bool operator()(const std::pair<std::string,double> &lhs, const std::pair<std::string,double>...
  10. Re: Define a comparator for std::map

    Hi, Paul,

    Why life is always more complicated than it needs to be? ;-)

    Now one more question: if I will have just one sorting in ascending order, will I have a guarantee that reverse_iterator...
  11. Re: Define a comparator for std::map

    Anybody?

    Thank you.
  12. Re: Define a comparator for std::map

    Hi,

    Well, Boost introduce an extra dependency and second map does not make much sense. ;-)





    std::map<std::string, std::set<std::pair<std::string, double>, AscendingPairComparator> >...
  13. Re: Define a comparator for std::map

    Hi,

    Well, std::map<> sorts its elements by the key, but isn't it possible to sort the container by value?
    std::set is not a "pair" container, and I need a container based on the "pair"...
  14. Re: Define a comparator for std::map

    Why I can't use std::map? What is the difference with the std::set?
    Thank you.
  15. Re: Define a comparator for std::map

    Apologies, for some reason I was not notified about the latest responses.

    Yes, this is what I'd like.
    I tried to implement it, but got compilation error:



    class Comparator
    {
    bool...
  16. Re: Define a comparator for std::map

    Hi,

    Consider the following code (pseudo-code):


    std::map<std::string,std::map<std::string, double> > m_mymap;
    std::map<std::string, double> m_temp;

    m_temp["Test1"] = 5.0;
    m_temp["Test2"]...
  17. [RESOLVED] Define a comparator for std::map

    Hi, ALL,
    First of all Happy New Year to everybody on the forum.
    Now to the problem.

    I am trying to define std::map<> container which will stay sorted on the value. Now depending on the key the...
  18. Replies
    3
    Views
    276

    Comparison of 2 double values

    Hi, ALL,
    Today I got stumped by very interesting situation.
    I have std::vector of players and each player have its own value. The value is of the type double, but the original value are of the...
  19. Replies
    8
    Views
    414

    Re: Memory allocation for the array

    Hi, guys,
    And the memory release should be done by:



    for( int i = 0; i < m_count; i++ )
    delete m_foo[i];
    delete[] m_foo;
  20. Replies
    8
    Views
    414

    Re: Memory allocation for the array

    Hi,


    Yes, I understand this.
    But then following code shouldn't compile as well for the same reason, right?



    class Base
    {
  21. Replies
    8
    Views
    414

    Memory allocation for the array

    Hi, ALL,
    I have very stupid problem that I'm looking at and I just need a pair of fresh eyes to help me solve it.

    Here is my code:




    class Base
    {
  22. Replies
    8
    Views
    526

    Re: std::map and comparator

    You mean use std::map instead of class? I am considering this.
    Please see my reply to superbonzo.
  23. Replies
    8
    Views
    526

    Re: std::map and comparator

    Hi, superbonzo,

    Ok, so the std::set is not a pair, it holds only unique values.
    But maybe it is simpler to even get rid of the Projection class and store the data in the std::map directly? What...
  24. Replies
    8
    Views
    526

    Re: std::map and comparator

    Hi,


    OK, here's what I'm looking for.
    I have a set of teams:
    Team1
    Team2
    Team3
    ....
  25. Replies
    8
    Views
    526

    Re: std::map and comparator

    Basically, what I'm looking for is if I change the value of m_value in the Projection class and then do loop on the outer std::map with iterator will I get the elements of the map according to the...
Results 1 to 25 of 568
Page 1 of 23 1 2 3 4


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center