
* 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 4f302ce..24cf7f3 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -534,6 +534,13 @@ * mln/value/rgb.hh: Make use of the new routine to print a correct type names in dump format. +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 5007baf..ad031a4 100644 --- a/milena/mln/convert/from_to.hxx +++ b/milena/mln/convert/from_to.hxx @@ -292,6 +292,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