From f7eecdafe0aa03d6d8bb4105e774d2fd738b803f Mon Sep 17 00:00:00 2001 From: Mathew Sutcliffe Date: Sat, 9 May 2015 00:31:33 +0100 Subject: [PATCH] refs #413, #416 Workaround GCC 4.7 bug. (cherry picked from commit 5b1a25489a545bddd66978a6b9a819742c5925d2) --- src/blackmisc/propertyindexvariantmap.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/blackmisc/propertyindexvariantmap.h b/src/blackmisc/propertyindexvariantmap.h index ebc708a01..0cbcb62de 100644 --- a/src/blackmisc/propertyindexvariantmap.h +++ b/src/blackmisc/propertyindexvariantmap.h @@ -25,6 +25,16 @@ namespace BlackMisc class CPropertyIndexVariantMap; + // workaround GCC 4.7 bug + namespace Aviation { template class CModulator; } + namespace Private + { + template struct is_default_constructible : std::is_default_constructible {}; +# if __GNUC__ == 4 && __GNUC_MINOR__ <= 7 + template struct is_default_constructible> : std::false_type {}; +# endif + } + namespace Mixin { @@ -66,14 +76,14 @@ namespace BlackMisc const Derived *derived() const { return static_cast(this); } Derived *derived() { return static_cast(this); } - template ::value, int>::type = 0> + template ::value, int>::type = 0> CVariant myself() const { return CVariant::from(*derived()); } - template ::value, int>::type = 0> + template ::value, int>::type = 0> void myself(const CVariant &variant) { *derived() = variant.to(); } - template ::value, int>::type = 0> + template ::value, int>::type = 0> CVariant myself() const { qFatal("isMyself should have been handled before reaching here"); return {}; } - template ::value, int>::type = 0> + template ::value, int>::type = 0> void myself(const CVariant &) { qFatal("isMyself should have been handled before reaching here"); } template