Imported Upstream version 1.0.0
[platform/upstream/iotivity.git] / resource / include / OCRepresentation.h
index b89b9fb..84e88e5 100644 (file)
@@ -89,6 +89,7 @@ namespace OC
     class OCRepresentation
     {
         public:
+            friend bool operator==(const OC::OCRepresentation&, const OC::OCRepresentation&);
             // Note: Implementation of all constructors and destructors
             // are all placed in the same location due to a crash that
             // was observed in Android, where merely constructing/destructing
@@ -254,7 +255,7 @@ namespace OC
                         return *this;
                     }
 
-                    AttributeItem& operator=(std::nullptr_t rhs)
+                    AttributeItem& operator=(std::nullptr_t /*rhs*/)
                     {
                         NullType t;
                         m_values[m_attrName] = t;
@@ -264,7 +265,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<typename T, typename= typename std::enable_if<
+                    template<typename T, typename std::enable_if<
                      std::is_same<T, int>::value ||
                      std::is_same<T, double>::value ||
                      std::is_same<T, bool>::value ||
@@ -285,14 +286,18 @@ namespace OC
                      std::is_same<T, std::vector<OCRepresentation>>::value ||
                      std::is_same<T, std::vector<std::vector<OCRepresentation>>>::value ||
                      std::is_same<T, std::vector<std::vector<std::vector<OCRepresentation>>>>::value
-                     >::type // enable_if
+                     , int>::type = 0// enable_if
                     >
                     operator T() const
                     {
                         return this->getValue<T>();
                     }
 
-                    operator std::nullptr_t() const
+                    template<typename T, typename std::enable_if<
+                        std::is_same<T, std::nullptr_t>::value
+                        , int>::type = 0
+                    >
+                    operator T() const
                     {
                         this->getValue<NullType>();
                         return nullptr;