Concept-check bug ?

Peter Dimov pdimov@mmltd.net
Fri Jun 17 12:56:00 GMT 2005


Jonathan Wakely wrote:
> On Fri, Jun 17, 2005 at 03:12:40PM +0300, Peter Dimov wrote:
>
>> It's illegal (17.4.3.6/2 last bullet), but useful.
>
> Thanks, Peter (I should have known that).
>
> Presumably the truly legal way to do it is with a (smart) pointer to
> the vector type:
>
>    struct A {
>        std::tr1::shared_ptr<std::vector<A> > v;
>
>        A() : v(new std::vector<A>) { }
>    };

With an out of line A() and a suitable copy constructor and an assignment 
operator, yes. 



More information about the Libstdc++ mailing list