Why doesn't boost::fusion::as_set remove duplicates from a boost::fusion::vector?

StackOverflow https://stackoverflow.com/questions/20647161

  •  19-09-2022
  •  | 
  •  

سؤال

I have:

auto my_vec2 = boost::fusion::make_vector(42,false,42);
auto my_set2 = boost::fusion::as_set(my_vec2);

and when I go to debug I was expecting my_set2 to only contain 42 and false, however it contained 42 twice. Why is this? If its a set surely the "keys" should be unique?

هل كانت مفيدة؟

المحلول

It’s your responsibility:

Precondition: There may be no duplicate key types.

(from this doc)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top