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

Add a missing conversion routine for object ids.

	* mln/convert/from_to.hxx,
	* mln/util/object_id.hh: Here.
parent a32b976c
2011-06-07 Guillaume Lazzara <z@lrde.epita.fr>
Add a missing conversion routine for object ids.
* mln/convert/from_to.hxx,
* mln/util/object_id.hh: Here.
2011-05-26 Guillaume Lazzara <z@lrde.epita.fr>
 
* mln/draw/site_set.hh: new.
// Copyright (C) 2008, 2009, 2010 EPITA Research and Development
// Copyright (C) 2008, 2009, 2010, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
......@@ -84,6 +84,7 @@ namespace mln
namespace util {
template <typename T> class array;
template <typename Tag, typename V> class object_id;
}
namespace value {
......@@ -473,6 +474,10 @@ namespace mln
from_to(from.second(), to.second());
}
// util::object_id<Tag,V> -> V.
template <typename Tag, typename V>
void from_to_(const util::object_id<Tag,V>& from, V& to_);
} // end of namespace mln::convert::over_load
} // end of namespace mln::convert
......
......@@ -38,6 +38,24 @@
namespace mln
{
// Forward declaration
namespace util { template <typename Tag, typename V> class object_id; }
namespace convert
{
namespace over_load
{
// object_id<Tag,V> -> V.
template <typename Tag, typename V>
void from_to_(const util::object_id<Tag,V>& from, V& to_);
} // end of namespace mln::convert::over_load
} // end of namespace mln::convert
namespace util
{
......@@ -90,9 +108,12 @@ namespace mln
bool
operator<(const object_id<Tag,V>& lhs, const object_id<Tag,V>& rhs);
} // end of namespace mln::util
# ifndef MLN_INCLUDE_ONLY
namespace util
{
template <typename Tag, typename V>
inline
......@@ -205,10 +226,26 @@ namespace mln
return lhs.value() < rhs.value();
}
} // end of namespace mln::util
# endif // ! MLN_INCLUDE_ONLY
namespace convert
{
} // end of namespace mln::util
namespace over_load
{
// object_id<Tag,V> -> V.
template <typename Tag, typename V>
void from_to_(const util::object_id<Tag,V>& from, V& to_)
{
to_ = from.value();
}
} // end of namespace mln::convert::over_load
} // end of namespace mln::convert
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln
......
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