POV-Ray : Newsgroups : povray.off-topic : Adventures with C++ : Re: An actual C++ question Server Time
29 Jul 2024 04:17:41 EDT (-0400)
  Re: An actual C++ question  
From: Kevin Wampler
Date: 23 May 2013 10:11:01
Message: <519e2375$1@news.povray.org>
On 5/23/2013 6:27 AM, Francois Labreque wrote:

>>>> 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).
>>
>> VisualStudio compiles this perfectly. GCC point-blank fails to compile
>> it. *sigh* Gotta love the number of inconsistencies between two
>> compilers for supposedly "the same" language...
>
> You are surprised that a Microsoft product allows something that is
> frowned upon by a more anal-retentive competitor?!?
>

Actually, I'm a little surprised that GCC didn't accept it, as that sort 
of things should be allowed under the C++11 standard 
(http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html) and 
GCC 4.7 is listed as supporting that feature 
(http://gcc.gnu.org/gcc-4.7/cxx0x_status.html).  In general GCC seems to 
have much better C++11 support that MSVC, so it's strange to see an 
example of the opposite -- perhaps Andrew's using an old version of GCC 
or something.


Post a reply to this message

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