|
Boost : |
From: joel de guzman (djowel_at_[hidden])
Date: 2001-11-28 18:57:27
----- Original Message -----
From: "Andrei Alexandrescu" :
> From: "David Abrahams" <david.abrahams_at_[hidden]>
> > as long as we're tinkering with names, consider "value_t" or
> > "value_type":
> >
> > template <typename T, T x>
> > struct value_t
> > {
> > static T const value = x;
> > };
> >
> > template <int x>
> > struct int_t : value_t<int, x> {};
> >
> > Did somebody already suggest that?
>
> I fear these will engender confusion because they are similar to size_t
and
> ptrdiff_t, types that don't have a generic programming conotation. So
> someone seeing int_t might think "hmmm, this must be some platform
specific
> integral type..."
I don't know much about loki nor mpl. I do have a metaprogramming library
that uses functional techniques such as currying and list processing, not
unlike mpl. I too have an int_t facility. Here's how I bind arguments:
add<int_t<1>, int_t<2> > --> direct, both args supplied
add<int_t<2>, _> --> 2nd arg, curry
add<_, int_t<2> > --> 1st arg, curry
add<_, _> --> both args, curry
Now imagine if I use int2type instead.... That's why I tend to
agree with mpl's this time.
--Joel
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk