POV-Ray : Newsgroups : povray.off-topic : Adventures with C++ : Re: An actual C++ question Server Time
29 Jul 2024 04:19:04 EDT (-0400)
  Re: An actual C++ question  
From: Francois Labreque
Date: 23 May 2013 09:26:48
Message: <519e1918@news.povray.org>

>>> 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?!?

>
> (VC emits endless warnings about "printf may be unsafe; please use
> printf_s instead". Apparently the latter function doesn't exist in GCC...)

They are MS-specific versions of the functions.

http://msdn.microsoft.com/en-us/library/8ef0s5kh%28v=vs.80%29.aspx
http://msdn.microsoft.com/en-us/library/239ffwa0%28v=vs.80%29.aspx

I'm sure the purists would frown that Microsoft decides to mess with 
<sdtio.h> instead of putting them in a "msstdio.h" or similar.  Way back 
when the dinosaurs still roamed the Earth, I used to hang in comp.lang.c 
and I vividly remember certain members being quite angry at Borland for 
pretending that conio.h was part of the standard headers and its 
functions part of the standard libraries.



-- 
/*Francois Labreque*/#local a=x+y;#local b=x+a;#local c=a+b;#macro P(F//
/*    flabreque    */L)polygon{5,F,F+z,L+z,L,F pigment{rgb 9}}#end union
/*        @        */{P(0,a)P(a,b)P(b,c)P(2*a,2*b)P(2*b,b+c)P(b+c,<2,3>)
/*   gmail.com     */}camera{orthographic location<6,1.25,-6>look_at a }


Post a reply to this message

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