POV-Ray : Newsgroups : povray.beta-test : Beta 37 and C++0x : Re: Beta 37 and C++0x Server Time
2 Jul 2024 14:08:21 EDT (-0400)
  Re: Beta 37 and C++0x  
From: Chris Cason
Date: 5 Jun 2010 10:32:29
Message: <4c0a5ffd@news.povray.org>
On 4/06/2010 09:01, clipka wrote:
> But the question has become pretty much academic anyway, given that 
> Chris has already announced that he will be addressing the issue himself.

I've made a change that pulls all the 'using namespace std' and 'using
namespace boost' out of the source, in favor of a few more specific
declarations in one header file (appropriately commented as to why):

  using std::string;
  using std::vector;
  using std::list;
  using std::runtime_error;
  using boost::shared_ptr;

since these are the most often used, scattered in many places throughout
the POV code. all other references to stdlib or boost classes are now
qualified or limited in scope to a single file. I wanted to do something
along these lines for a while anyhow, since I do think it's cleaner than
pulling in all of std (you may notice that in the code I checked in for
e.g. the shellouts the other week I was preferring qualifiers rather than
importing namespaces).

of course this doesn't fix the problem with VS 2010, because some of its
header files refer to std::tr1::shared_ptr, so unless we go to the trouble
of explicitly qualifying shared_ptr everywhere we use it (and then have to
change that if we ever decide to use the tr1 version instead), it's still
not going to compile.

if C++ supported template typedefs we could fix it more cleanly that way,
but currently that's not yet the case. we could alternatively use the
struct rebind workaround, but I'm not sure that's any better than just
appending boost:: everywhere (though at least if we do go tr1 we only
change it in one place).

I'll probably fix it eventually as I'd like to see it work with compilers
that have tr1. do you have any opinion regards the typedef struct
workaround vs explicit scoping option?

-- Chris


Post a reply to this message

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