From: Gabriel Corona Date: Tue, 28 Jun 2016 09:58:18 +0000 (+0200) Subject: Replace std::aligned_union<> which is not available in GNU libstdc++ 4.8 X-Git-Tag: v3_14~845^2~4^2 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/224a19c5c06a8b600908ec3465cdbb578d50108e Replace std::aligned_union<> which is not available in GNU libstdc++ 4.8 --- diff --git a/include/xbt/functional.hpp b/include/xbt/functional.hpp index 99cba0d7e1..2429b5bf0a 100644 --- a/include/xbt/functional.hpp +++ b/include/xbt/functional.hpp @@ -114,11 +114,23 @@ private: struct whatever {}; // Union used for storage: +#if 0 typedef typename std::aligned_union<0, void*, std::pair, std::pair >::type TaskUnion; +#else + union TaskUnion { + void* ptr; + std::pair funcptr; + std::pair memberptr; + char any1[sizeof(std::pair)]; + char any2[sizeof(std::pair)]; + TaskUnion() {} + ~TaskUnion() {} + }; +#endif // Is F suitable for small buffer optimization? template