Commit 95c18786 authored by cutealien's avatar cutealien

Avoid argument lookup ambiguity in swap when used in combination with stl....

Avoid argument lookup ambiguity in swap when used in combination with stl. Using same trick as boost now and use 2 different template parameters in it.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3281 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 3c8c56d3
......@@ -162,10 +162,14 @@ namespace core
}
//! swaps the content of the passed parameters
template <class T>
inline void swap(T& a, T& b)
{
T c(a);
// Note: We use the same trick as boost and use two template arguments to
// avoid ambiguity when swapping objectsof an Irrlicht type that has not
// it's own swap overload. Otherwise we get conflicts with some compilers
// in combination with stl.
template <class T1, class T2>
inline void swap(T1& a, T2& b)
{
T1 c(a);
a = b;
b = c;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment