Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2006-02-24 07:32:34


"Andy Little" <andy_at_[hidden]> writes:

> "David Abrahams" writes
>
>> The result of the transform is only required to be "concept-identical"
>> to the result you're looking for.
>
> IMO that behaviour is sloppy. I see no reason why (at least)
>
> boost::is_same < plus< int_<1> ,int_<1> >::type, int_<2> > shouldnt be true.

Patches welcome, and all that. If you can figure out how to do it
without greatly complicating the library, I'm sure Aleksey would be
glad to adopt your code. Until then, I'll thank you not to sling
words like "sloppy" around so blithely.

> mpl models itself on runtime C++ but in this case it deviates from following
> runtime behaviour for no real benefit. Note also that tightening the behaviour
> wouldnt break any conforming code ;-)

In the user's case, the real benefit is that it drastically reduces
the number of lines of implementation code in the library, which has a
real impact on the library's usability.

    vector<int_<1>, int_<2> >

    vector<integral_c<int,1>, integral_c<int,2> >

    vector_c<int, 1, 2>

are all different types, and they always will be. There's nothing we
can do about that, period. Arranging it so that you always get the
exact type you expect would require a great deal more code than we're
using now, and may not even be possible.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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