Boost logo

Boost :

Subject: Re: [boost] [TTI] macro to "box" types for subsequent traits extraction?
From: Rein Halbersma (rhalbersma_at_[hidden])
Date: 2014-05-07 07:47:55


On Wed, May 7, 2014 at 10:55 AM, Rob Stewart <robertstewart_at_[hidden]>wrote:

> On May 5, 2014 11:03:01 AM EDT, Rein Halbersma <rhalbersma_at_[hidden]>
> wrote:
> >
> >I have a small feature request for the Type Traits Introspection
> >library: a
> >macro BOOST_TTI_BOX_TYPE(U) that defines a class template box_type<T>
> >with
> >a nested typedef named "type" that equals T::U.
>
> Where does the macro get T?

T would be the template parameter of the class template generated by the
macro

#define BOOST_TTI_BOX_TYPE(U) \
template<class T> \
struct box_type_ ## U \
{ \
    using type = typename T::U; \
};

> >Small self-contained example:
> >http://coliru.stacked-crooked.com/a/76b9abf4aaf00350
>
> Posting the code facilitates later searching and prevents problems on
> finding out later (should the linked site disappear or the linked code be
> deleted on the future). It also permits quoting portions in replies.
>

OK, will do next time.

Rein


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