last-svn-commit-38-g8336d46 Fix the way to convert unsigned to float.

* mln/convert/from_to.hxx: New conversion utilities. * mln/convert/impl/from_unsigned_to_value.hh: New conversion utilities. --- milena/ChangeLog | 7 +++++++ milena/mln/convert/from_to.hxx | 4 ++++ milena/mln/convert/impl/from_unsigned_to_value.hh | 10 ++++++++++ 3 files changed, 21 insertions(+), 0 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index 10c5def..3804c90 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,3 +1,10 @@ +2010-06-21 Yann Jacquelet <jacquelet@lrde.epita.fr> + + Fix the way to convert unsigned to float. + + * mln/convert/from_to.hxx: New conversion utilities. + * mln/convert/impl/from_unsigned_to_value.hh: New conversion utilities. + 2009-12-02 Yann Jacquelet <jacquelet@lrde.epita.fr> Fix the outside template use case for the convolve macros. diff --git a/milena/mln/convert/from_to.hxx b/milena/mln/convert/from_to.hxx index ebc30cd..8334b14 100644 --- a/milena/mln/convert/from_to.hxx +++ b/milena/mln/convert/from_to.hxx @@ -261,6 +261,10 @@ namespace mln void from_to_(const Value<F>& from, Value<T>& to); + // unsigned -> float + void + from_to_(const unsigned& from, float& to); + // double-> Value template <typename V> void diff --git a/milena/mln/convert/impl/from_unsigned_to_value.hh b/milena/mln/convert/impl/from_unsigned_to_value.hh index ad54cff..fe09a3e 100644 --- a/milena/mln/convert/impl/from_unsigned_to_value.hh +++ b/milena/mln/convert/impl/from_unsigned_to_value.hh @@ -118,6 +118,16 @@ namespace mln internal::from_unsigned_to_value_dispatch(from, to); } + + // Facades. + // unsigned-> float + void + from_to_(const unsigned& from, float& to) + { + to = from; + } + + } // end of namespace mln::convert::over_load -- 1.5.6.5
participants (1)
-
Yann Jacquelet