I look in boost :: swap:
namespace boost_swap_impl { template<class T> BOOST_GPU_ENABLED void swap_impl(T& left, T& right) { using namespace std;
The implementation also contains the following comment:
// Note: the implementation of this utility contains various workarounds: // - swap_impl is put outside the boost namespace, to avoid infinite // recursion (causing stack overflow) when swapping objects of a primitive // type.
However, I do not understand why primitive types (and why only primitive types) cause infinite recursion.
c ++ boost argument-dependent-lookup
Anton Frolov
source share