POV-Ray : Newsgroups : povray.off-topic : Adventures with C++ : Re: An actual C++ question Server Time
29 Jul 2024 04:17:06 EDT (-0400)
  Re: An actual C++ question  
From: Kevin Wampler
Date: 21 May 2013 13:38:00
Message: <519bb0f8@news.povray.org>
On 5/21/2013 10:32 AM, Kevin Wampler wrote:
> On 5/21/2013 10:25 AM, Orchid Win7 v1 wrote:
>> However, I can't seem to figure out what to write in the constructor.
>> I've got a field that looks like
>>
>>    boost::shared_ptr<std::vector<Foo>> _foo;
>>
>> What do I need to do to initialise this correctly?
>
>
> boost::shared_ptr<std::vector<Foo>> _foo(new std::vector<Foo>());
>

Oh, and it's probably best to write it like this:

boost::shared_ptr<std::vector<Foo> > _foo(new std::vector<Foo>());

Since some compilers will complain about using >> in a type definition 
(due to the ambiguity with the >> operator).


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.