Boost logo

Boost :

Subject: Re: [boost] N2346 - Defaulted and Deleted Functions emulation
From: Beman Dawes (bdawes_at_[hidden])
Date: 2009-03-01 10:34:31

On Thu, Nov 20, 2008 at 10:49 AM, vicente.botet
<vicente.botet_at_[hidden]> wrote:
> Hi,
> is there an interest in a N2346 - Defaulted and Deleted Functions emulation
> The idea been to use some macros that will use the =default, =delete if the compiler provides it and replace this macros by whatever has the same semantics. Alexandrescu introduced already two macros NON_ALIAS and NON_HEAP_ALLOCATED when talking about strict locks.
> Attached a draft for the default and deleted functions.
> Only one remark the macors must be used on the public part and without trailing ';', e.g.
> class X {

My concern is that:


emulates the syntax but not the semantics of


The point of using the C++0x T()=default syntax is probably to ensure
that the class is a POD.

In C++03, the class designer has to make a design tradeoff. If
providing a default constructor is more important than making the
class a POD, then your emulation is OK. But if the priorities are the
other way around, then the macro should just eliminate the default

I'm concerned about hiding that semantic difference inside a macro.


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