|
Boost : |
From: Arkadiy Vertleyb (vertleyb_at_[hidden])
Date: 2005-06-29 08:41:34
"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?
Regards,
Arkadiy
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk