Boost logo

Boost Users :

Subject: [Boost-users] Multi index assistance
From: Etienne Philip Pretorius (icewolfhunter_at_[hidden])
Date: 2010-08-14 12:32:25


Hello List,

I have defined a multi_index container, but I am not able to populate
the container. Is there something that I have missed?

     struct element {
         element(
             std::uint8_t x,
             std::uint8_t y,
             std::uint8_t z
         ) : x(x),y(y),z(z) {};
         std::uint8_t x,y,z;
     };

     typedef boost::multi_index_container<
         element,
         boost::multi_index::indexed_by<
             boost::multi_index::ordered_non_unique<
                 boost::multi_index::member<
                     element, std::uint8_t, &element::x
>
>,
             boost::multi_index::ordered_non_unique<
                 boost::multi_index::member<
                     element, std::uint8_t, &element::y
>
>,
             boost::multi_index::ordered_unique<
                 boost::multi_index::member<
                     element, std::uint8_t, &element::z
>
>
>
> matrix_t;

Then I define:

     matrix_t m;
     element e(1,2,3);
     m.insert <-- not valid

So what is the correct way to populate the container?

Kind Regards,
Etienne


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net