Afficher un message
Vieux 07/04/2008, 22h22   #4
Pete Becker
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: replicating default constructor's "non-initializing state"

On 2008-04-07 15:19:10 -0400, "Victor Bazarov" <v.Abazarov@comAcast.net> said:

> Jason Doucette wrote:
>> Question:
>> Are there any compiler settings (even compiler specific ones; I am
>> using MSVC++) that state MY default constructor behaves exactly like
>> the regular default constructor?

>
> Not that I know of.


For the future, though, C++0x will let you do this:

struct S
{
S() = default;
S(int);
};

with the effect that the compiler will generate that default
constructor as if you hadn't declared the other one.

--
Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The
Standard C++ Library Extensions: a Tutorial and Reference
(www.petebecker.com/tr1book)

  Réponse avec citation
 
Page generated in 0,05412 seconds with 9 queries