|
Boost : |
Subject: Re: [boost] [type_erasure]suggest tuple doc contain requires clause specifying T... are unique
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2012-07-30 17:58:12
AMDG
On 07/30/2012 11:06 AM, Larry Evans wrote:
> 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.
>
The placeholders don't have to be unique, but
if a placeholder is used more than once, the
corresponding constructor arguments all need to
be the same type. This is another instance of
the same bug that you reported earlier (with the
any constructor.). A fix to that, will automatically
fix this as well.
In Christ,
Steven Watanabe
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk