David Abrahams wrote:
> That's because void_ is for MPL internal use only; it's not a type
> you should manipulate

While I agree that _some_ user needs for a special unique type a
better handled by introducing a new one (otherwise you'll get yourself
into situation like we have right now, only in your own code :), I don't
agree that we should deny the occasional need for a special type in
many simpler cases - like Drazen's one. It would just make user life
unnecessary more complicated than it should be.

Besides, 'void_' _is_ a public type:

    begin<non-sequence-type>::type === void_
    order<Set,non-existing-key>::type === void_

and a couple of others I don't remember off hand :).


> (I think Aleksey doesn't believe me, but I'm
> about to prove it... <wink>).

I don't _agree_ :).

>
> Observe the definition of identity (comments added for exposition
> purposes):
>
> template<typename T = void_>
> struct identity
> {
>     typedef T type;
> };
>
>
> // identity<void_> is a metafunction class which makes it efficient
> // to pass mpl::identity<> where a lambda expr/metafunction class is
> // expected.
> template<>
> struct identity< void_ >
> {
>     template<
>         class T1, class T2 =void_, class T3 =void_, class T4 =void_, class
T5 =void_
>     >
>     struct apply
>       : identity< T1 >
>     {};
> };
>
> // specialization of lambda<identity<> > for efficiency.
> template<>
> struct lambda< identity< void_ > >
> {
>     typedef identity< void_ > type;
> };

IMO we should just stop using 'void_' for internal purposes and give it
up to users :).

Aleksey
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to