mirror of https://github.com/CGAL/cgal
do not use exception in Object::assign. g++3.4 produces a segfault with -O2
This commit is contained in:
parent
dec7522a6e
commit
b30d3daa2b
|
|
@ -88,12 +88,21 @@ class Object
|
|||
bool assign(T &t) const
|
||||
{
|
||||
if(obj) {
|
||||
#ifdef CGAL_USE_ANY_BAD_CAST
|
||||
try {
|
||||
t = boost::any_cast<T>(*obj);
|
||||
return true;
|
||||
} catch(...) {
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
const T* res = boost::any_cast<T>(&(*obj));
|
||||
if (res){
|
||||
t=*res;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue