Boost logo

Boost :

Subject: Re: [boost] [Re:Opaque Typedef] observations on opaque typedef
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2011-10-20 15:42:00


On 10/20/2011 06:45 PM, Robert Ramey wrote:

> Of course one define a macro
>
> #define NEW_OPAQUE_TYPE(new_name, current_type) \
> struct new_name : public current_type {};
>
> but I haven't really considered all the implications of this in depth.
>
> To summarize, I expected to find a new feature in C++0X but
> found something else - now I'm wondering what I missed.

Maybe you missed this:

#define NEW_OPAQUE_TYPE(new_name, current_type) \
struct new_name : current_type \
{ \
   using current_type::current_type; \
};

The 'using' here is is a new C++11 feature that is useful for defining
strong typedefs.


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