Boost logo

Boost Users :

Subject: [Boost-users] VS2005 compiler error in swap() definition after including flat_map.hpp
From: æ£ÄÏÒ ôÒÕÛËÉÎ (ted-xp_at_[hidden])
Date: 2013-11-01 13:01:53


Dear All,

I encountered a strange problem recently.
It's perfectly reproducable under VS2005 even with the latest boost 1_55 rc.

Here's the minimal reproducable example:

// -----
//#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.

Should this incompatibility be regarded as a bug?

Best regards,
Fedor Trushkin


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net