Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The visualizer multi_index_container<*,indexed_by<hashed_unique<...>>> is not working correctly. #39

Open
hawk2411 opened this issue Jun 10, 2022 · 0 comments

Comments

@hawk2411
Copy link

Small example:
`
//------------

  struct employee
    {
        int         id;
        std::string name;
        int         age;
        employee(int id_, std::string name_, int age_) :id(id_), name(name_), age(age_) {}
    };

   /* tags for accessing the corresponding indices of employee_set */

    struct id {};
    struct name {};
    struct age {};
    struct member {};

    /* see Compiler specifics: Use of member_offset for info on
    * BOOST_MULTI_INDEX_MEMBER
    */

    /* Define a multi_index_container of employees with following indices:
    *   - a unique index sorted by employee::int,
    *   - a non-unique index sorted by employee::name,
    *   - a non-unique index sorted by employee::age.
    */

    typedef multi_index_container<
        employee,
        indexed_by<
        hashed_unique<
        tag<id>, BOOST_MULTI_INDEX_MEMBER(employee, int, id)>,
        ordered_non_unique<
        tag<name>, BOOST_MULTI_INDEX_MEMBER(employee, std::string, name)>,
        ordered_non_unique<
        tag<age>, BOOST_MULTI_INDEX_MEMBER(employee, int, age)>
        >
    > employee_set;

    employee_set es;

    es.insert(employee(0, "Joe", 31));
    es.insert(employee(1, "Robert", 27));
    es.insert(employee(2, "John", 40));
    es.insert(employee(2, "Aristotle", 2387));
    es.insert(employee(3, "Albert", 20));
    es.insert(employee(4, "John", 57));

   employee_set es;

'

The items of the instance "es" are not shown in the Watch View of the Visual Studio debugger. Tested in version 2017, 2019 and 2022.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant