---
milena/ChangeLog | 6 ++++++
milena/mln/convert/from_to.hh | 19 +++++++++++++------
2 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 1a2ea7a..83dd467 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,11 @@
2010-11-18 Guillaume Lazzara <z(a)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(a)lrde.epita.fr>
+
Fix disabled unit tests in Milena.
* tests/unit_test/disabled_tests: Add a missing new line at end of
diff --git a/milena/mln/convert/from_to.hh b/milena/mln/convert/from_to.hh
index fa57ac3..1b04847 100644
--- a/milena/mln/convert/from_to.hh
+++ b/milena/mln/convert/from_to.hh
@@ -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
--
1.5.6.5