Boost logo

Boost :

From: Henrik Ravn (web_at_[hidden])
Date: 2002-08-21 01:42:12


> No, that declares a function also. Try this:
>
> struct foo {
> private: foo(foo const&);
> };
>
> foo x((foo()));

I just did; using vc++7 I get a warning saying no appropriate default
constructor available, which is just what I would expect.
If I add a default constructor it says that it can't access the private
copy constructor, which means that it tries to call the copy
constructor. (This will be optimized away, but the copy constructor has
to be available).

Also:
        int x(int()); // this works: now x == 0

So AFAICT it is not a function declaration.

be well
-h-


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