POV-Ray : Newsgroups : povray.beta-test : Beta 37 and C++0x : Re: Beta 37 and C++0x Server Time
30 Jun 2024 17:54:49 EDT (-0400)
  Re: Beta 37 and C++0x  
From: Thorsten Froehlich
Date: 29 May 2010 16:03:47
Message: <4c017323$1@news.povray.org>
On 29.05.10 20:06, Fredrik Eriksson wrote:
> I just tried to compile beta 37 with Visual C++ 2010. I got it working
> eventually, but there is at least one major problem that needs to be
> fixed. The code uses 'shared_ptr' without a namespace qualifier, and
> instead imports the entire 'boost' namespace. However, because the code
> also imports the entire 'std' namespace there is a conflict between the
> 'shared_ptr' from Boost and the one in the standard library (one of the
> C++0x features in VC2010). Fully qualifying each and every reference to
> 'shared_ptr' (thank you, "Replace in files") of course fixes this
> particular problem.

Then you should file a bug report with Microsoft because their library (and 
probably the compiler as well) enables non-standard behavior by default. 
Supporting draft standard features by default is extremely poor practice, or 
more precisely, a serious product defect. But it is of course typical M$ 
behavior to pull such stunts and forget an off-switch, so you may have to 
dig for it or patch your system library by hand <sigh>

> Linux users may run into the same problem if/when they upgrade to a
> newer version of libstdc++. A similar conflict can be expected for
> 'boost::thread' as well.

Before release POV-Ray will have to abandon boost::thread anyway, because it 
has too many limitations over existing C threading APIs (lack of access to 
the stack size in particular).

> Why does the POV-Ray code blindly import whole namespaces anyway? There
> is a reason why 'using namespace' statements are considered poor practice.

POV-Ray's usage of C++ is fully ISO standard compliant. If and when there 
will be an approved new version of the ISO C++ standard, POV-Ray source code 
will be made compatible. It is pretty pointless to chase a draft standard 
with any production source code, that would be miserable practice, as is 
demanding such compatibility.

	Thorsten


Post a reply to this message

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