From b30d3daa2b9623a01d49f9bebf93c846569f5791 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 12 Jun 2013 17:39:31 +0200 Subject: [PATCH] do not use exception in Object::assign. g++3.4 produces a segfault with -O2 --- STL_Extension/include/CGAL/Object.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/STL_Extension/include/CGAL/Object.h b/STL_Extension/include/CGAL/Object.h index 7c7449c959c..e41a41c9dc1 100644 --- a/STL_Extension/include/CGAL/Object.h +++ b/STL_Extension/include/CGAL/Object.h @@ -88,12 +88,21 @@ class Object bool assign(T &t) const { if(obj) { + #ifdef CGAL_USE_ANY_BAD_CAST try { t = boost::any_cast(*obj); return true; } catch(...) { return false; } + #else + const T* res = boost::any_cast(&(*obj)); + if (res){ + t=*res; + return true; + } + return false; + #endif } else { return false; }