Boost logo

Boost :

Subject: Re: [boost] [Re:Opaque Typedef] observations on opaque typedef
From: Robert Ramey (ramey_at_[hidden])
Date: 2011-10-20 12:45:04

Mathias Gaunard wrote:
> On 10/20/2011 09:43 AM, Robert Ramey wrote:
>> I realize that this is whole different kettle of fixh than
>> BOOST_STRONG_TYPE or OPAQUE_TYPE. So this might be considered off
>> topic. or maybe not.
> How is it not exactly the same thing?

a) BOOST_STRONG_TYPE and OPAQUE_TYPE presumes that the base type is supports
all integer
operations while what I'm looking for doesn't make that presumption.

c) the new "using ..." creates an alias rather than a new type so this
is totall different than BOOST_STRONG_TYPE and OPAQUE_TYPE

> You want to create a new type that, for all practical purposes, is the
> same as the original one, but that can be specialized and overloaded
> on.


> The point of template alias is indeed to create an alias, not a new
> type.
> It has nothing to do with a so-called "strong typedef".

lol - that's my point.

Confusion arises when one googles C++ opaque type. This raises
a number of papers which address the subject but seem to suggest
that the "template alias" feature will create a new type. But a careful
reading of the latest documents suggest that this is not the case. This
is the motivation for my question.

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.

Robert Ramey

Boost list run by bdawes at, gregod at, cpdaniel at, john at