Commit 75486e11 authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

mln/convert/from_to.hh: Use value::cast for default builtin conversions and...

mln/convert/from_to.hh: Use value::cast for default builtin conversions and use specific from_to_ overloads for float/double conversions
parent 99f6f2ae
2010-11-18 Guillaume Lazzara <z@lrde.epita.fr>
* mln/convert/from_to.hh: Use value::cast for default builtin
conversions and use specific from_to_ overloads for float/double
conversions
2010-11-18 Guillaume Lazzara <z@lrde.epita.fr>
 
Fix disabled unit tests in Milena.
......@@ -158,12 +158,7 @@ namespace mln
from_to_dispatch(metal::false_, const F& from,
metal::false_, T& to)
{
to = mln::value::cast<T>(from);
// We prefer using value::cast instead of a from_to_ overload.
// We don't want to write explicitly every from_to_ overload
// for all built-in types.
// over_load::from_to_(from, to);
over_load::from_to_(from, to);
}
......@@ -229,6 +224,8 @@ namespace mln
exact(to) = exact(from);
}
// Exact same type.
template <typename T>
inline
void
......@@ -238,6 +235,16 @@ namespace mln
}
// Default conversion.
template <typename F, typename T>
inline
void
from_to_(const F& from, T& to)
{
to = mln::value::cast<T>(from);
}
} // end of namespace mln::convert::over_load
......
Supports Markdown
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