From ca25f608ed10f6c9b5adbdeadb74068f476a04c6 Mon Sep 17 00:00:00 2001 From: Erich Keane Date: Tue, 8 Sep 2015 15:03:46 -0700 Subject: [PATCH] Made the AttributeItem nullptr_t enabled only for direct conversions This will fix the GCC5.0 and CLANG 3.5 and newer compile issues. Change-Id: Ib9c6b69c29e4c6ac70f0d04a2c791a60eae004f9 Signed-off-by: Erich Keane Reviewed-on: https://gerrit.iotivity.org/gerrit/2414 Reviewed-by: Kevron Rees Tested-by: jenkins-iotivity Reviewed-by: Jon A. Cruz --- resource/include/OCRepresentation.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/resource/include/OCRepresentation.h b/resource/include/OCRepresentation.h index 73d85c410..1beafa1d4 100644 --- a/resource/include/OCRepresentation.h +++ b/resource/include/OCRepresentation.h @@ -264,7 +264,7 @@ namespace OC // Enable-if required to prevent conversions to alternate types. This prevents // ambigious conversions in the case where conversions can include a number of // types, such as the string constructor. - template::value || std::is_same::value || std::is_same::value || @@ -285,14 +285,18 @@ namespace OC std::is_same>::value || std::is_same>>::value || std::is_same>>>::value - >::type // enable_if + , int>::type = 0// enable_if > operator T() const { return this->getValue(); } - operator std::nullptr_t() const + template::value + , int>::type = 0 + > + operator T() const { this->getValue(); return nullptr; -- 2.34.1