felipealmeida pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=fec589cbdc6716a739aec217c69b6ad726a2d5ad

commit fec589cbdc6716a739aec217c69b6ad726a2d5ad
Author: Felipe Magno de Almeida <[email protected]>
Date:   Mon Jun 6 02:49:28 2016 -0300

    eina-cxx: Restrict templated constructor
---
 src/bindings/cxx/eina_cxx/eina_value.hh | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/bindings/cxx/eina_cxx/eina_value.hh 
b/src/bindings/cxx/eina_cxx/eina_value.hh
index cc57191..0f348c1 100644
--- a/src/bindings/cxx/eina_cxx/eina_value.hh
+++ b/src/bindings/cxx/eina_cxx/eina_value.hh
@@ -35,7 +35,10 @@ template <typename T>
 struct _eina_value_traits_base;
 
 template <typename T>
-struct _eina_value_traits_aux;
+struct _eina_value_traits_aux
+{
+   typedef std::false_type is_specialized;
+};
 
 /**
  * @internal
@@ -44,6 +47,7 @@ template <typename T>
 struct _eina_value_traits_base
 {
   typedef T type;
+  typedef std::true_type is_specialized;
 
   static ::Eina_Value* create()
   {
@@ -335,7 +339,7 @@ public:
    * @param v Value to be stored.
    */
   template <typename T>
-  value(T v)
+  value(T v, typename 
std::enable_if<_eina_value_traits<T>::is_specialized::value>::type* = 0)
   {
     primitive_init(v);
   }
@@ -438,6 +442,9 @@ public:
     eina_value_free(_raw);
   }
 
+  value(Eina_Value* raw)
+    : _raw(raw) {}
+
   /**
    * @brief Copy Constructor. Create an generic value storage holding the same 
value of @p other.
    * @param other Another <tt>eina::value</tt> object.

-- 


Reply via email to