[gtkmm] Fix the Glib::Value<> specialization for Cairo objects



commit 99b29a36d743cba5a69abb243ed3e3c96bec5261
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Sun Nov 5 13:20:05 2017 +0100

    Fix the Glib::Value<> specialization for Cairo objects
    
    * gdk/gdkmm/value_cairo.h: The specialization is restricted to
    Cairo::RefPtr<Cairo::Region> and Cairo::RefPtr<Cairo::Surface>.
    This is necessary because Cairo::RefPtr is not a separate class, it's an
    alias for std::shared_ptr. Bug 788513

 gdk/gdkmm/value_cairo.h |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/gdk/gdkmm/value_cairo.h b/gdk/gdkmm/value_cairo.h
index c71d39a..0481359 100644
--- a/gdk/gdkmm/value_cairo.h
+++ b/gdk/gdkmm/value_cairo.h
@@ -53,10 +53,14 @@ GType get_base_type<::Cairo::Surface>();
 
 namespace Glib
 {
-/** Partial specialization of Glib::Value<> for Cairo::RefPtr<> to a Cairomm object.
+/** Specialization of Glib::Value<> for Cairo::RefPtr<Cairo::Region>
+ * and Cairo::RefPtr<Cairo::Surface>.
  */
-template <typename T, typename Enable>
-class Value<::Cairo::RefPtr<T>, Enable> : public ValueBase_Boxed
+template <typename T>
+class Value<::Cairo::RefPtr<T>, typename std::enable_if<
+  std::is_base_of<::Cairo::Region, T>::value ||
+  std::is_base_of<::Cairo::Surface, T>::value>::type>
+: public ValueBase_Boxed
 {
 public:
   using CppType = ::Cairo::RefPtr<T>;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]