|
![](/i/fill.gif) |
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
|
![](/i/fill.gif) |