Boost logo

Boost :

Subject: [boost] [type_erasure]suggest tuple doc contain requires clause specifying T... are unique
From: Larry Evans (cppljevans_at_[hidden])
Date: 2012-07-30 14:06:12


http://steven_watanabe.users.sourceforge.net/type_erasure/libs/type_erasure/doc/html/boost/type_erasure/tuple.html

Specifies that the T... are placeholders; however, it doesn't
specify that they be unique; hence,

  tuple<concept,_a,_a> x(int(0),std::vector<int>(0));

would satisfy the current description but wouldn't be
right. Of course no one would intentionally do that; however,
if the Tags are calculated in some meta-program, it might
happened accidentally. Hence the requires class should also
say, "If T... are not unique, no diagnostic occurs", or something
similar.

The reason I think "no diagnostic occurs" is that I've looked
briefly in tuple.hpp, at the:

     ::boost::type_erasure::cons<Concept, T...> impl;

in the class tuple definition and the cons definition, and I don't
see any check for duplicates.

-regards,
Larry


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk