Boost logo

Boost :

From: Peder Holt (peder.holt_at_[hidden])
Date: 2005-06-29 09:05:42


On 6/29/05, Arkadiy Vertleyb <vertleyb_at_[hidden]> wrote:
> "Peder Holt" <peder.holt_at_[hidden]> wrote
>
> > It would also be possible to add a bit of syntactic sugar to allow:
> > enum color {...};
> > template<color> some_class {};
> > template<template <typename,int> class T> struct tt_class {};
> > template<typename A1,T A2> struct dependent_class {};
> > BOOST_TYPEOF_REGISTER_TEMPLATE(some_class, (enum(color)) );
> > BOOST_TYPEOF_REGISTER_TEMPLATE(tt_class, (template((typename)(int))) );
> > BOOST_TYPEOF_REGISTER_TEMPLATE(dependent_class,
> (typename)(dependent(0)) );
>
> Unless I am missing something, there may be some problems with this.
>
> The first thing that needs to be done is pasting prefix and suffix to allow
> handling something like "unsigned int":
>
> PREFIX_unsigned int_SUFFIX
>
> However doing the same with, say, "enum(color)" would have to produce:
>
> PREFIX_enum(color)_SUFFIX,
>
> And I am pretty sure some preprocessors (for example GCC) would have a
> problem with pasting anything to ')'.
>
> But maybe you have something else in mind?

My idea was to let _SUFFIX expand to nothing, but you are probably
right in that this is less portable. I have only tested it with VC7.1.
I'll give it a go with GCC as well, to see what happens.

Regards,
Peder

>
> Regards,
> Arkadiy
>
>
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>


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