[glibmm] C++11: gmmproc: Use using instead of typedef.



commit e4ed4492e0f9053804d1fe436550728421e83cbf
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Mar 31 11:19:31 2016 +0200

    C++11: gmmproc: Use using instead of typedef.

 glib/src/value_basictypes.h.m4      |    4 ++--
 glib/src/variant_basictypes.h.m4    |    2 +-
 tools/m4/class_boxedtype.m4         |    4 ++--
 tools/m4/class_boxedtype_static.m4  |    4 ++--
 tools/m4/class_generic.m4           |    4 ++--
 tools/m4/class_gobject.m4           |    8 ++++----
 tools/m4/class_interface.m4         |   16 ++++++++--------
 tools/m4/class_opaque_copyable.m4   |    4 ++--
 tools/m4/class_opaque_refcounted.m4 |    4 ++--
 tools/m4/class_shared.m4            |   16 ++++++++--------
 tools/m4/signal.m4                  |   12 ++++++------
 tools/m4/vfunc.m4                   |    4 ++--
 12 files changed, 41 insertions(+), 41 deletions(-)
---
diff --git a/glib/src/value_basictypes.h.m4 b/glib/src/value_basictypes.h.m4
index f9648c0..06320cf 100644
--- a/glib/src/value_basictypes.h.m4
+++ b/glib/src/value_basictypes.h.m4
@@ -33,8 +33,8 @@ template <>
 class Value<$1> : public ValueBase
 {
 public:
-  typedef $1 CppType;
-  typedef g$2 CType;
+  using CppType = $1;
+  using CType = g$2;
 
   static GType value_type() G_GNUC_CONST;
 
diff --git a/glib/src/variant_basictypes.h.m4 b/glib/src/variant_basictypes.h.m4
index a6b6ec0..959a8e5 100644
--- a/glib/src/variant_basictypes.h.m4
+++ b/glib/src/variant_basictypes.h.m4
@@ -43,7 +43,7 @@ template <>
 class Variant<$1> : public VariantBase
 {
 public:
-  typedef $2 CType;
+  using CType = $2;
 
   /// Default constructor.
   Variant<$1>()
diff --git a/tools/m4/class_boxedtype.m4 b/tools/m4/class_boxedtype.m4
index 32b42ad..ed8a481 100644
--- a/tools/m4/class_boxedtype.m4
+++ b/tools/m4/class_boxedtype.m4
@@ -202,8 +202,8 @@ dnl
 _IMPORT(SECTION_CLASS1)
 public:
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
-  typedef __CPPNAME__ CppObjectType;
-  typedef __CNAME__ BaseObjectType;
+  using CppObjectType = __CPPNAME__;
+  using BaseObjectType = __CNAME__;
 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
   /** Get the GType for this class, for use with the underlying GObject type system.
diff --git a/tools/m4/class_boxedtype_static.m4 b/tools/m4/class_boxedtype_static.m4
index 9624257..926ac49 100644
--- a/tools/m4/class_boxedtype_static.m4
+++ b/tools/m4/class_boxedtype_static.m4
@@ -168,8 +168,8 @@ dnl
 _IMPORT(SECTION_CLASS1)
 public:
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
-  typedef __CPPNAME__ CppObjectType;
-  typedef __CNAME__ BaseObjectType;
+  using CppObjectType = __CPPNAME__;
+  using BaseObjectType = __CNAME__;
 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
   __CPPNAME__`'(const __CPPNAME__& other) noexcept;
diff --git a/tools/m4/class_generic.m4 b/tools/m4/class_generic.m4
index 590e81b..6395946 100644
--- a/tools/m4/class_generic.m4
+++ b/tools/m4/class_generic.m4
@@ -44,8 +44,8 @@ dnl
 _IMPORT(SECTION_CLASS1)
 public:
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
-  typedef __CPPNAME__ CppObjectType;
-  typedef __CNAME__ BaseObjectType;
+  using CppObjectType = __CPPNAME__;
+  using BaseObjectType = __CNAME__;
 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
 private:
diff --git a/tools/m4/class_gobject.m4 b/tools/m4/class_gobject.m4
index 77943ef..dd9c173 100644
--- a/tools/m4/class_gobject.m4
+++ b/tools/m4/class_gobject.m4
@@ -249,10 +249,10 @@ _IMPORT(SECTION_CLASS1)
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
 
 public:
-  typedef __CPPNAME__ CppObjectType;
-  typedef __CPPNAME__`'_Class CppClassType;
-  typedef __CNAME__ BaseObjectType;
-  typedef __REAL_CNAME__`'Class BaseClassType;
+  using CppObjectType = __CPPNAME__;
+  using CppClassType = __CPPNAME__`'_Class;
+  using BaseObjectType = __CNAME__;
+  using BaseClassType = __REAL_CNAME__`'Class;
 
   // noncopyable
   __CPPNAME__`'(const __CPPNAME__&) = delete;
diff --git a/tools/m4/class_interface.m4 b/tools/m4/class_interface.m4
index e3c3230..0116045 100644
--- a/tools/m4/class_interface.m4
+++ b/tools/m4/class_interface.m4
@@ -45,10 +45,10 @@ define(`_PH_CLASS_DECLARATION_INTERFACE',`dnl
 class __CPPNAME__`'_Class : public __CPPPARENT__`'_Class
 {
 public:
-  typedef __CPPNAME__ CppObjectType;
-  typedef __CNAME__ BaseObjectType;
-  typedef __CCLASS__ BaseClassType;
-  typedef __CPPPARENT__`'_Class CppClassParent;
+  using CppObjectType = __CPPNAME__;
+  using BaseObjectType = __CNAME__;
+  using BaseClassType = __CCLASS__;
+  using CppClassParent = __CPPPARENT__`'_Class;
 
   friend class __CPPNAME__;
 
@@ -239,10 +239,10 @@ _IMPORT(SECTION_CLASS1)
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
 
 public:
-  typedef __CPPNAME__ CppObjectType;
-  typedef __CPPNAME__`'_Class CppClassType;
-  typedef __CNAME__ BaseObjectType;
-  typedef __CCLASS__ BaseClassType;
+  using CppObjectType = __CPPNAME__;
+  using CppClassType = __CPPNAME__`'_Class;
+  using BaseObjectType = __CNAME__;
+  using BaseClassType = __CCLASS__;
 
   // noncopyable
   __CPPNAME__`'(const __CPPNAME__&) = delete;
diff --git a/tools/m4/class_opaque_copyable.m4 b/tools/m4/class_opaque_copyable.m4
index 4fdab1e..0e17919 100644
--- a/tools/m4/class_opaque_copyable.m4
+++ b/tools/m4/class_opaque_copyable.m4
@@ -193,8 +193,8 @@ dnl
 _IMPORT(SECTION_CLASS1)
 public:
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
-  typedef __CPPNAME__ CppObjectType;
-  typedef __CNAME__ BaseObjectType;
+  using CppObjectType = __CPPNAME__;
+  using BaseObjectType = __CNAME__;
 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
 ifdef(`__BOOL_CUSTOM_DEFAULT_CTOR__',`dnl
diff --git a/tools/m4/class_opaque_refcounted.m4 b/tools/m4/class_opaque_refcounted.m4
index e33cf52..e8d645b 100644
--- a/tools/m4/class_opaque_refcounted.m4
+++ b/tools/m4/class_opaque_refcounted.m4
@@ -137,8 +137,8 @@ dnl
 _IMPORT(SECTION_CLASS1)
 public:
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
-  typedef __CPPNAME__ CppObjectType;
-  typedef __CNAME__ BaseObjectType;
+  using CppObjectType = __CPPNAME__;
+  using BaseObjectType = __CNAME__;
 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
 ifelse(__OPAQUE_FUNC_NEW,NONE,`dnl
diff --git a/tools/m4/class_shared.m4 b/tools/m4/class_shared.m4
index 7a3e0fb..6880412 100644
--- a/tools/m4/class_shared.m4
+++ b/tools/m4/class_shared.m4
@@ -105,14 +105,14 @@ class __CPPNAME__`'_Class : public Glib::Class
 {
 public:
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
-  typedef __CPPNAME__ CppObjectType;
-  typedef __REAL_CNAME__ BaseObjectType;
+  using CppObjectType = __CPPNAME__;
+  using BaseObjectType = __REAL_CNAME__;
 ifdef(`__BOOL_DO_NOT_DERIVE_GTYPE__',`dnl
-  typedef __CPPPARENT__`'_Class CppClassParent;
+  using CppClassParent = __CPPPARENT__`'_Class;
 ',`dnl
-  typedef __REAL_CNAME__`'Class BaseClassType;
-  typedef __CPPPARENT__`'_Class CppClassParent;
-  typedef __REAL_CPARENT__`'Class BaseClassParent;
+  using BaseClassType = __REAL_CNAME__`'Class;
+  using CppClassParent = __CPPPARENT__`'_Class;
+  using BaseClassParent = __REAL_CPARENT__`'Class;
 ')dnl
 
   friend class __CPPNAME__;
@@ -286,8 +286,8 @@ define(`_STRUCT_PROTOTYPE',`dnl
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
 ifdef(`__BOOL_STRUCT_NOT_HIDDEN__',`dnl
 ',`dnl
-typedef struct _`'__CNAME__ __CNAME__;
-typedef struct _`'__CNAME__`'Class __CNAME__`'Class;
+using __CNAME__ = struct _`'__CNAME__;
+using __CNAME__`'Class = struct _`'__CNAME__`'Class;
 ')dnl
 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
 undefine(`__BOOL_STRUCT_NOT_HIDDEN__')dnl
diff --git a/tools/m4/signal.m4 b/tools/m4/signal.m4
index f62e316..5b680f4 100644
--- a/tools/m4/signal.m4
+++ b/tools/m4/signal.m4
@@ -65,7 +65,7 @@ ifelse($8,`1',,`dnl Do not generate the implementation if it should be custom:
 static $2 __CPPNAME__`'_signal_$4_callback`'(__CNAME__`'* self, _COMMA_SUFFIX($3)`'void* data)
 {
   using namespace __NAMESPACE__;
-  typedef sigc::slot< $5`'_COMMA_PREFIX($6) > SlotType;
+  using SlotType = sigc::slot< $5`'_COMMA_PREFIX($6) >;
 
   auto obj = dynamic_cast<__CPPNAME__*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
   // Do not try to call a signal on a disassociated wrapper.
@@ -98,7 +98,7 @@ ifelse($12, `', `dnl
   }
 ifelse($2,void,,`dnl else
 
-  typedef $2 RType;
+  using RType = $2;
   return RType`'();
 ')dnl
 }
@@ -107,7 +107,7 @@ ifelse($2,void,,`dnl else
 static $2 __CPPNAME__`'_signal_$4_notify_callback`'(__CNAME__`'* self, _COMMA_SUFFIX($3)`' void* data)
 {
   using namespace __NAMESPACE__;
-  typedef sigc::slot< void`'_COMMA_PREFIX($6) > SlotType;
+  using SlotType = sigc::slot< void`'_COMMA_PREFIX($6) >;
 
   auto obj = dynamic_cast<__CPPNAME__*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
   // Do not try to call a signal on a disassociated wrapper.
@@ -135,7 +135,7 @@ ifelse($12, `', `dnl
     }
   }
 
-  typedef $2 RType;
+  using RType = $2;
   return RType`'();
 }
 ')dnl endif
@@ -292,7 +292,7 @@ dnl    g_assert(base != nullptr);
     ifelse($4,void,,`return ')(*base->$2)`'($6);
 ifelse($4,void,,`dnl
 
-  typedef $4 RType;
+  using RType = $4;
   return RType`'();
 ')dnl
 }
@@ -343,7 +343,7 @@ ifelse($8,refreturn,`dnl Assume Glib::wrap() is correct if refreturn is requeste
     return 
_CONVERT($4,$3,`(*base->$2)`'(ifelse(`$7',1,const_cast<__CNAME__*>(gobj()),gobj())`'_COMMA_PREFIX($6))');
 ')dnl
 
-  typedef $3 RType;
+  using RType = $3;
   return RType`'();
 ')dnl
 }
diff --git a/tools/m4/vfunc.m4 b/tools/m4/vfunc.m4
index 7819d3e..5b6f114 100644
--- a/tools/m4/vfunc.m4
+++ b/tools/m4/vfunc.m4
@@ -141,7 +141,7 @@ dnl  g_assert(base != nullptr);
 ifelse($4,void,,`dnl
 
 ifelse(`$15', `',`dnl
-  typedef $4 RType;
+  using RType = $4;
   return RType`'();
 ',`dnl
   return _CONVERT($3,$4,`$15');
@@ -202,7 +202,7 @@ ifelse($10,errthrow,`dnl
   }
 
 ifelse(`$14', `',`dnl
-  typedef $3 RType;
+  using RType = $3;
   return RType`'();
 ',`dnl
   return $14;


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