[Boost-bugs] [Boost C++ Libraries] #9338: VS2005 compiler errors in swap() definition after including container/memory_util.hpp

Subject: [Boost-bugs] [Boost C++ Libraries] #9338: VS2005 compiler errors in swap() definition after including container/memory_util.hpp
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-11-04 05:27:40


#9338: VS2005 compiler errors in swap() definition after including
container/memory_util.hpp
---------------------------------------+------------------------
 Reporter: Fedor Trushkin <ted-xp@…> | Owner: igaztanaga
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: container
  Version: Boost 1.54.0 | Severity: Problem
 Keywords: |
---------------------------------------+------------------------
 This problem is perfectly reproducable under VS2005 even with the latest
 boost 1_55 rc.

 Here's the minimal reproducable example:

 // -----
 // This was the original inclusion actually
 //#include <boost/container/flat_map.hpp>
 #include <boost/container/detail/config_begin.hpp>
 #include <boost/intrusive/detail/memory_util.hpp>
 #include <boost/container/detail/memory_util.hpp>

 void swap();
 // ------

 In VS2005 this innocent piece of code yields:
 // ------
 error C2365: 'swap' : redefinition; previous definition was 'formerly
 unknown identifier'
 // ------

 VS2010 and GCC 4.5.2 have no complaints.

 Looks like VS2005 compiler is entangled somehow by
 BOOST_INTRUSIVE_HAS_MEMBER magic.
 Actually, it's quite a headache that with VS2005 one can't introduce
 swap() after, say, flat_map is included.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9338>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:14 UTC