Boost logo

Boost :

Subject: Re: [boost] [preprocessor] Warning: Incoming
From: Eric Niebler (eric_at_[hidden])
Date: 2011-07-01 11:34:35


On 6/30/2011 11:09 PM, Paul Mensonides wrote:
> This notion of a, b, c being a good way to store elements (which are
> possibly empty sequences of preprocessing tokens and whitespace
> separations) needs to die. I was just watching some of the Boostcon
> videos and in one of them (something like Haskell = C++ TMP) there are
> examples that utilize variadic templates to pass around lists of types.
> However, in the example, they are "open". I.e. not bounded by something
> that collects them as a singular entity. I don't have it in front of me,
> but something like:
>
> template<class, class... T> struct count {
> enum { value = 1 + count<T...>::value };
> };
>
> template<> struct count<> {
> enum { value = 0 };
> };
>
> ...but this is terrible. It doesn't take away from the point of the
> talk, but it should be something like count<typelist<A, B, C>>, not
> count<A, B, C>.

I'm not disagreeing, but I'd like to know why you believe this is true
for templates as well as macros.

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk