POV-Ray : Newsgroups : povray.off-topic : Adventures with C++ : Re: An actual C++ question Server Time
29 Jul 2024 04:22:25 EDT (-0400)
  Re: An actual C++ question  
From: Warp
Date: 23 May 2013 11:41:32
Message: <519e38ac@news.povray.org>
Kevin Wampler <nob### [at] nowherenet> 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>());

*Where* are you doing that?

If you mean it like this:

class Foobar
{
    boost::shared_ptr<std::vector<Foo>> _foo(new std::vector<Foo>());
};

then it works, but only in C++11. I think Andrew needed to do it in C++98.

-- 
                                                          - Warp


Post a reply to this message

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