#179 Loki::AssocVector constructor accepts duplicated keys

closed-fixed
None
5
2011-09-30
2011-08-08
Felipe
No

Hi !!

Loki::AssocVector constructor accepts duplicate keys in realease loki 0.1.7.
The following code prints 2 instead of 1.

std::pair<int,char> p[] = { std::make_pair(1,'a'), std::make_pair(1,'b') };
Loki::AssocVector<int, char> w(p, p+2);
std::cout << "SIZE = " << w.size() << std::endl;

Thanks

Discussion

  • Richard Sposato

    Richard Sposato - 2011-09-30
    • assigned_to: nobody --> rich_sposato
    • status: open --> closed-fixed
     
  • Richard Sposato

    Richard Sposato - 2011-09-30

    Fixed in revision 1127.

    Fixed by replacing existing ctor body with code that creates temporary map and then inserts elements into AssocVector.

    Added test project for AssocVector in revisions 1125 and 1126.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks