Commit e69979da authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

Add more from_to overloards.

	* mln/convert/impl/from_unsigned_to_value.hh,
	* mln/value/label.hh: Here.
parent bed27157
2011-03-14 Guillaume Lazzara <z@lrde.epita.fr>
Add more from_to overloards.
* mln/convert/impl/from_unsigned_to_value.hh,
* mln/value/label.hh: Here.
2011-03-01 Guillaume Lazzara <z@lrde.epita.fr>
 
* mln/labeling/fill_holes.hh: Improve speed.
// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
// (LRDE)
// Copyright (C) 2009, 2010, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -48,11 +48,15 @@ namespace mln
namespace convert
{
/// Conversion of an unsigned \p from towards a value \p to.
template <typename V>
void
from_to(const unsigned& from, Value<V>& to);
/// Conversion of an unsigned \p from towards a value \p to.
template <typename V>
void
from_to(const unsigned& from, Value<V>& to);
/// Conversion of an unsigned \p from towards a bool \p to.
inline
void
from_to_(const unsigned& from, bool& to);
# ifndef MLN_INCLUDE_ONLY
......@@ -120,6 +124,16 @@ namespace mln
}
// Facades.
// unsigned-> bool
inline
void
from_to_(const unsigned& from, bool& to)
{
to = (from != 0u);
}
} // end of namespace mln::convert::over_load
......
// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development
// Laboratory (LRDE)
// Copyright (C) 2007, 2008, 2009, 2010, 2011 EPITA Research and
// Development Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -119,6 +119,11 @@ namespace mln
void
from_to_(const value::label<n>& from, bool& to_);
// label -> unsigned.
template <unsigned n>
void
from_to_(const value::label<n>& from, unsigned& to_);
} // end of namespace mln::convert::over_load
} // end of namespace mln::convert
......@@ -233,6 +238,7 @@ namespace mln
to_ = from;
}
// int_u<n> -> bool
template <unsigned n>
inline
void
......@@ -241,6 +247,16 @@ namespace mln
to_ = (from != 0u);
}
// int_u<n> -> unsigned
template <unsigned n>
inline
void
from_to_(const value::label<n>& from, unsigned& to_)
{
to_ = from;
}
} // end of namespace mln::convert::over_load
} // end of namespace mln::convert
......
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