Opened 9 years ago

#9624 new Bugs

boost::icl::swap causes ambiguity with std::swap with ADL

Reported by: Nathan Thomas <nthomas@…> Owned by: Joachim Faulhaber
Milestone: To Be Determined Component: ICL
Version: Boost 1.53.0 Severity: Problem
Keywords: Cc:

Description

With C++11, the swap() function overload in boost::icl is ambiguous with std::swap due to ADL. I'm using boost 1.53, but this doesn't appear to be addressed in git yet either. It think it's the exact same problem previously addressed in Boost.Variant (https://svn.boost.org/trac/boost/ticket/2839).

I've applied the same fix (i.e., using separate template params for two arguments to swap, making it less specialized than std::swap) to my local copy of boost, and it appears to resolve it.

I'm using clang 3.4 / libstdc++ from gcc 4.7.2 / boost 1.53, compile line ==> clang -std=c++11 -o test_adl test_adl.cc

test file and error message attached.

Thanks, --Nathan

Attachments (2)

test_adl.cc (344 bytes ) - added by Nathan Thomas <nthomas@…> 9 years ago.
test_adl.out (2.3 KB ) - added by Nathan Thomas <nthomas@…> 9 years ago.

Download all attachments as: .zip

Change History (2)

by Nathan Thomas <nthomas@…>, 9 years ago

Attachment: test_adl.cc added

by Nathan Thomas <nthomas@…>, 9 years ago

Attachment: test_adl.out added
Note: See TracTickets for help on using tickets.