#pragma once #include // for std::move or for std::exchange #ifdef DXX_HAVE_CXX14_EXCHANGE using std::exchange; #else template static inline T1 exchange(T1 &a, T2 &&b) { T1 t = std::move(a); a = std::forward(b); return t; } #endif