Boost logo

Boost Users :

Subject: [Boost-users] [boost::fusion] map or set uniqueness guarantees
From: Ovanes Markarian (om_boost_at_[hidden])
Date: 2011-04-29 09:28:25


Hello *,

I am wondering if I should expect some uniqueness guarantees on contained
element from fusion set or map containers?

In this example:

struct print_value
{
  template<class T>
  void operator()(T& v)const
  {
    cout << typeid(T).name() << " has value: " << v << endl;
  }
};

  boost::fusion::set<int, int, int> s;
  boost::fusion::for_each(s, print_value());

I get 3 lines - one for each int I put in. I would expect only one line.

What are my expectations for at_key? Which int would it return? Which type
is going to be returned after I inserted the same type again? May be the
better question would be, is the new type inserted as the head element or at
the end of the underlying list?

Many thanks for the anserws?

With Kind Regards,
Ovanes



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