From 5a595a9a921fe3d2f9871a1d8ff48c3d29587e0c Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Mon, 18 Aug 2003 18:51:55 +0000 Subject: [PATCH] repair the previous GCC fix, now works on gcc 2.95, 3.0, and 3.3 [SVN r19686] --- include/boost/optional.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/boost/optional.hpp b/include/boost/optional.hpp index 45d1196..a8257da 100644 --- a/include/boost/optional.hpp +++ b/include/boost/optional.hpp @@ -271,8 +271,8 @@ bool operator != ( optional const& x, optional const& y ) // namespace optional_detail { -#ifdef __GNUC__ - // workaround for GCC (JM): +#if defined(__GNUC__) && (BOOST_WORKAROUND(__GNUC__, <= 2) || __GNUC__ == 3 && BOOST_WORKAROUND(__GNUC_MINOR__, < 3)) + // workaround for GCC earlier than version 3.3 (JM): using std::swap; #endif @@ -296,7 +296,7 @@ void optional_swap ( optional& x, optional& y ) } else if ( !!x && !!y ) { -#ifndef BOOST_NO_STDC_NAMESPACE +#if !(defined(__GNUC__) && (BOOST_WORKAROUND(__GNUC__, <= 2) || __GNUC__ == 3 && BOOST_WORKAROUND(__GNUC_MINOR__, < 3))) // allow for Koenig lookup using std::swap ; #endif