|
Boost : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-12-18 08:30:14
From: "Aleksey Gurtovoy" <alexy_at_[hidden]>
> Peter Dimov wrote:
> > I think that a compile-time port of boost.bind would be a
> > valuable addition to MPL.
>
> Peter, this is totally cool! The absence of full-fledged compile-time bind
> was the only thing that my expression templates implementation lacked, and
I
> am so glad you did it! (now I can throw my own half-working version ;). In
> fact, bind implements 90% of the compile-time lambda facility, and the
rest
> 10% is below:
[ code that took me several minutes to figure out snipped ;-) ]
> The only caveat here is that 'is_same' class template is not exactly
> 'boost::is_same':
[...]
> A lot of type traits class templates do not provide the '::type' interface
> if they "return" boolean value, and this is a show stopper for the bind
> library.
Yes. I wonder what the best name for the MPL is_same is. mpl::equal?
> Oh, and _1, _2, etc. should be complete types - consider, for example
> size_of<_1> ;). Well, actually this is a part of much bigger issue...
They would probably be complete but this is an implementation detail. :-)
Of course I wouldn't miss the opportunity to propose some new names (we'd be
off-topic if I don't ;-) ):
make_f_x -> quote1
make_f_xy -> quote2
size_of -> ct_sizeof
integral_c -> ct_value
int_c<n> -> ct_value<int, n>
bool_t<b> -> ct_value<bool, b>
-- Peter Dimov Multi Media Ltd.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk