From 224a19c5c06a8b600908ec3465cdbb578d50108e Mon Sep 17 00:00:00 2001 From: Gabriel Corona Date: Tue, 28 Jun 2016 11:58:18 +0200 Subject: [PATCH] Replace std::aligned_union<> which is not available in GNU libstdc++ 4.8 --- include/xbt/functional.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 -- 2.20.1