|
Boost : |
From: Fernando Cacciola (fcacciola_at_[hidden])
Date: 2002-08-21 09:06:18
----- Original Message -----
From: "Henrik Ravn" <web_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Wednesday, August 21, 2002 3:42 AM
Subject: SV: [boost] Generic construction
> > 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.
>
AFAICT, *it is* a function declaration; but anyway, that's what bcc5.5.1
says it is:
int x( int() ) ;
x = 2 ; // Lvalue required
int y(int());
int y = 0 ; // Multiple declaration for y(int (*)())
Fernando Cacciola
Sierra s.r.l.
fcacciola_at_[hidden]
www.gosierra.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk