
----- Mensaje original ----- De: Sean Perry <perry@ca.ibm.com> Fecha: Jueves, Noviembre 22, 2007 8:28 pm Asunto: Re: [boost] [config][vacpp8.0] BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL should be defined? Para: boost@lists.boost.org
This code does have the name hiding.overload resolution issues still.
I don't see how name hiding is involved here: ... void swap(foo& x){swap_(x);} void swap_(foo& x) { using std::swap; swap(t,x.t); } ... Note that swap(t,x.t) is called inside swap_, with "_" suffix.
Can you change the call to swap so you use "std::swap(t.x, t.y)" instead of the using declaration and "swap(t.x,t.y)".
This wouldd avoid using ADL, which is what the problem's all about.
The following compiles for me:
#include <algorithm>
template<typename T> struct foo { T t; foo():t(0){} void swap(foo& x){swap(x);} void swap(foo& x) [...]
Maybe you've pasted your code wrong, cause the above redeclares foo::swap(). Joaquín M López Muñoz Telefónica, Investigación y Desarrollo