Commit 80fddd17 authored by Sylvain Thery's avatar Sylvain Thery

add easy type conversions ..continue

parent 0c31658d
......@@ -86,6 +86,7 @@ inline const OUT* convertPtr(const IN* vec)
template <typename OUT, typename IN>
inline std::vector<OUT>& convertVector(std::vector<IN>& vec)
{
......@@ -102,6 +103,25 @@ inline const std::vector<OUT>& convertVector(const std::vector<IN>& vec)
}
template <typename OUT, typename IN>
inline const std::list<OUT>& convertList(const std::list<IN>& vec)
{
assert(sizeof(IN) == sizeof(OUT) || "incompatible size cast");
return *(reinterpret_cast< const std::list<OUT>* >(&vec));
}
template <typename OUT, typename IN>
inline std::list<OUT>& convertList(std::list<IN>& vec)
{
assert(sizeof(IN) == sizeof(OUT) || "incompatible size cast");
return *(reinterpret_cast< std::list<OUT>* >(&vec));
}
} // namespace Utils
} // namespace CGoGN
......
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