Commit 381cfb19 authored by Davis King's avatar Davis King

Minor cleanup

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403383
parent 6a81ba6b
...@@ -305,8 +305,10 @@ namespace dlib ...@@ -305,8 +305,10 @@ namespace dlib
T& get( T& get(
) )
{ {
// ERROR: You are trying to get a type of object that isn't currently // ERROR: You are trying to get a type of object that isn't
// in the type_safe_union. // representable by this type_safe_union. I.e. The given
// type T isn't one of the ones given to this object's template
// arguments.
COMPILE_TIME_ASSERT(( is_same_type<T,T1>::value || COMPILE_TIME_ASSERT(( is_same_type<T,T1>::value ||
is_same_type<T,T2>::value || is_same_type<T,T2>::value ||
is_same_type<T,T3>::value || is_same_type<T,T3>::value ||
...@@ -319,7 +321,8 @@ namespace dlib ...@@ -319,7 +321,8 @@ namespace dlib
is_same_type<T,T10>::value is_same_type<T,T10>::value
)); ));
construct<T>(); return *reinterpret_cast<T*>(mem.get()); construct<T>();
return *reinterpret_cast<T*>(mem.get());
} }
}; };
......
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