From f61e1d0e8b6c48d940ba9d2690543af9192614c1 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Thu, 31 Mar 2016 11:14:58 +0200 Subject: C++11: .h/.cc files: Replace typedefs with using. --- examples/thread/dispatcher2.cc | 2 +- gio/giomm/socketsource.h | 2 +- glib/glibmm/arrayhandle.h | 58 +++++++++--------- glib/glibmm/class.h | 4 +- glib/glibmm/containerhandle_shared.h | 60 +++++++++---------- glib/glibmm/containers.h | 70 +++++++++++----------- glib/glibmm/error.cc | 2 +- glib/glibmm/error.h | 2 +- glib/glibmm/exceptionhandler.cc | 2 +- glib/glibmm/helperlist.h | 20 +++---- glib/glibmm/interface.h | 6 +- glib/glibmm/listhandle.h | 28 ++++----- glib/glibmm/main.h | 18 +++--- glib/glibmm/object.h | 34 +++++------ glib/glibmm/objectbase.h | 4 +- glib/glibmm/pattern.h | 2 +- glib/glibmm/private/interface_p.h | 4 +- glib/glibmm/private/object_p.h | 6 +- glib/glibmm/property.h | 4 +- glib/glibmm/propertyproxy.h | 6 +- glib/glibmm/propertyproxy_base.h | 2 +- glib/glibmm/random.h | 2 +- glib/glibmm/refptr.h | 2 +- glib/glibmm/sarray.h | 2 +- glib/glibmm/signalproxy.h | 8 +-- glib/glibmm/signalproxy_connectionnode.h | 4 +- glib/glibmm/slisthandle.h | 28 ++++----- glib/glibmm/threadpool.h | 2 +- glib/glibmm/timer.h | 2 +- glib/glibmm/ustring.h | 62 +++++++++---------- glib/glibmm/value.h | 26 ++++---- glib/glibmm/value_custom.h | 8 +-- glib/glibmm/vectorutils.h | 96 +++++++++++++++--------------- glib/glibmm/wrap.cc | 2 +- glib/glibmm/wrap.h | 2 +- tests/glibmm_btree/main.cc | 4 +- tests/glibmm_interface_move/main.cc | 10 ++-- tests/glibmm_nodetree/main.cc | 2 +- tests/glibmm_null_containerhandle/main.cc | 2 +- tests/glibmm_null_vectorutils/main.cc | 2 +- tests/glibmm_variant/main.cc | 14 ++--- tools/extra_defs_gen/generate_extra_defs.h | 2 +- 42 files changed, 309 insertions(+), 309 deletions(-) diff --git a/examples/thread/dispatcher2.cc b/examples/thread/dispatcher2.cc index 28912936..dbe176c7 100644 --- a/examples/thread/dispatcher2.cc +++ b/examples/thread/dispatcher2.cc @@ -41,7 +41,7 @@ public: void signal_finished_emit(); void print() const; - typedef sigc::signal type_signal_end; + using type_signal_end = sigc::signal; static type_signal_end& signal_end(); private: diff --git a/gio/giomm/socketsource.h b/gio/giomm/socketsource.h index 2096816f..c1345c6d 100644 --- a/gio/giomm/socketsource.h +++ b/gio/giomm/socketsource.h @@ -100,7 +100,7 @@ SignalSocket signal_socket( class SocketSource : public Glib::IOSource { public: - typedef Gio::SocketSource CppObjectType; + using CppObjectType = Gio::SocketSource; static Glib::RefPtr create(const Glib::RefPtr& socket, Glib::IOCondition condition, diff --git a/glib/glibmm/arrayhandle.h b/glib/glibmm/arrayhandle.h index 19454cba..02ec243c 100644 --- a/glib/glibmm/arrayhandle.h +++ b/glib/glibmm/arrayhandle.h @@ -51,7 +51,7 @@ template typename Tr::CType* create_array(For pbegin, std::size_t size, Tr) { - typedef typename Tr::CType CType; + using CType = typename Tr::CType; CType* const array = static_cast(g_malloc((size + 1) * sizeof(CType))); CType* const array_end = array + size; @@ -90,7 +90,7 @@ create_bool_array(For pbegin, std::size_t size) template struct ArraySourceTraits { - typedef typename Tr::CType CType; + using CType = typename Tr::CType; static std::size_t get_size(const Cont& cont) { return cont.size(); } @@ -106,7 +106,7 @@ struct ArraySourceTraits template struct BoolArraySourceTraits { - typedef gboolean CType; + using CType = gboolean; static std::size_t get_size(const Cont& cont) { return cont.size(); } @@ -123,7 +123,7 @@ struct BoolArraySourceTraits template struct ArraySourceTraits { - typedef typename Tr::CType CType; + using CType = typename Tr::CType; static std::size_t get_size(const CType* array) { @@ -148,7 +148,7 @@ struct ArraySourceTraits : ArraySourceTraits template struct ArraySourceTraits { - typedef typename Tr::CType CType; + using CType = typename Tr::CType; static std::size_t get_size(const CType*) { return (N - 1); } @@ -171,14 +171,14 @@ template class ArrayHandleIterator { public: - typedef typename Tr::CppType CppType; - typedef typename Tr::CType CType; + using CppType = typename Tr::CppType; + using CType = typename Tr::CType; - typedef std::random_access_iterator_tag iterator_category; - typedef CppType value_type; - typedef std::ptrdiff_t difference_type; - typedef value_type reference; - typedef void pointer; + using iterator_category = std::random_access_iterator_tag; + using value_type = CppType; + using difference_type = std::ptrdiff_t; + using reference = value_type; + using pointer = void; explicit inline ArrayHandleIterator(const CType* pos); @@ -231,15 +231,15 @@ template > class ArrayHandle { public: - typedef typename Tr::CppType CppType; - typedef typename Tr::CType CType; + using CppType = typename Tr::CppType; + using CType = typename Tr::CType; - typedef CppType value_type; - typedef std::size_t size_type; - typedef std::ptrdiff_t difference_type; + using value_type = CppType; + using size_type = std::size_t; + using difference_type = std::ptrdiff_t; - typedef Glib::Container_Helpers::ArrayHandleIterator const_iterator; - typedef Glib::Container_Helpers::ArrayHandleIterator iterator; + using const_iterator = Glib::Container_Helpers::ArrayHandleIterator; + using iterator = Glib::Container_Helpers::ArrayHandleIterator; template inline ArrayHandle(const Cont& container); @@ -286,18 +286,18 @@ template <> class ArrayHandle> { public: - typedef ArrayHandle> Me; - typedef Container_Helpers::TypeTraits Tr; + using Me = ArrayHandle>; + using Tr = Container_Helpers::TypeTraits; - typedef Tr::CppType CppType; - typedef Tr::CType CType; + using CppType = Tr::CppType; + using CType = Tr::CType; - typedef CppType value_type; - typedef std::size_t size_type; - typedef std::ptrdiff_t difference_type; + using value_type = CppType; + using size_type = std::size_t; + using difference_type = std::ptrdiff_t; - typedef Glib::Container_Helpers::ArrayHandleIterator const_iterator; - typedef Glib::Container_Helpers::ArrayHandleIterator iterator; + using const_iterator = Glib::Container_Helpers::ArrayHandleIterator; + using iterator = Glib::Container_Helpers::ArrayHandleIterator; template inline ArrayHandle(const Cont& container); @@ -383,7 +383,7 @@ private: * * @ingroup ContHandles */ -typedef ArrayHandle StringArrayHandle; +using StringArrayHandle = ArrayHandle; /***************************************************************************/ /* Inline implementation */ diff --git a/glib/glibmm/class.h b/glib/glibmm/class.h index 691c1bff..bc5a06ab 100644 --- a/glib/glibmm/class.h +++ b/glib/glibmm/class.h @@ -67,7 +67,7 @@ public: GType clone_custom_type(const char* custom_type_name) const; /// The type that holds pointers to the interfaces of custom types. - typedef std::vector interface_class_vector_type; + using interface_class_vector_type = std::vector; /** Register a static custom GType, derived from the parent of this class's type. * The parent type of the registered custom type is the same C class as the parent @@ -103,7 +103,7 @@ private: public: #ifndef DOXYGEN_SHOULD_SKIP_THIS // The type that holds the values of the interface properties of custom types. - typedef std::vector iface_properties_type; + using iface_properties_type = std::vector; // The quark used for storing/getting the interface properties of custom types. static GQuark iface_properties_quark; #endif diff --git a/glib/glibmm/containerhandle_shared.h b/glib/glibmm/containerhandle_shared.h index 7084e9b8..dffce99b 100644 --- a/glib/glibmm/containerhandle_shared.h +++ b/glib/glibmm/containerhandle_shared.h @@ -107,9 +107,9 @@ namespace Container_Helpers template struct TypeTraits { - typedef T CppType; - typedef T CType; - typedef T CTypeNonConst; + using CppType = T; + using CType = T; + using CTypeNonConst = T; static CType to_c_type(const CppType& item) { return item; } static CppType to_cpp_type(const CType& item) { return item; } @@ -128,9 +128,9 @@ struct TypeTraits template struct TypeTraits { - typedef T* CppType; - typedef typename T::BaseObjectType* CType; - typedef typename T::BaseObjectType* CTypeNonConst; + using CppType = T*; + using CType = typename T::BaseObjectType*; + using CTypeNonConst = typename T::BaseObjectType*; static CType to_c_type(CppType ptr) { return Glib::unwrap(ptr); } static CType to_c_type(CType ptr) { return ptr; } @@ -160,9 +160,9 @@ struct TypeTraits template struct TypeTraits { - typedef const T* CppType; - typedef const typename T::BaseObjectType* CType; - typedef typename T::BaseObjectType* CTypeNonConst; + using CppType = const T*; + using CType = const typename T::BaseObjectType*; + using CTypeNonConst = typename T::BaseObjectType*; static CType to_c_type(CppType ptr) { return Glib::unwrap(ptr); } static CType to_c_type(CType ptr) { return ptr; } @@ -191,9 +191,9 @@ struct TypeTraits template struct TypeTraits> { - typedef Glib::RefPtr CppType; - typedef typename T::BaseObjectType* CType; - typedef typename T::BaseObjectType* CTypeNonConst; + using CppType = Glib::RefPtr; + using CType = typename T::BaseObjectType*; + using CTypeNonConst = typename T::BaseObjectType*; static CType to_c_type(const CppType& ptr) { return Glib::unwrap(ptr); } static CType to_c_type(CType ptr) { return ptr; } @@ -227,9 +227,9 @@ struct TypeTraits> template struct TypeTraits> { - typedef Glib::RefPtr CppType; - typedef const typename T::BaseObjectType* CType; - typedef typename T::BaseObjectType* CTypeNonConst; + using CppType = Glib::RefPtr; + using CType = const typename T::BaseObjectType*; + using CTypeNonConst = typename T::BaseObjectType*; static CType to_c_type(const CppType& ptr) { return Glib::unwrap(ptr); } static CType to_c_type(CType ptr) { return ptr; } @@ -267,9 +267,9 @@ struct TypeTraits> template <> struct TypeTraits { - typedef Glib::ustring CppType; - typedef const char* CType; - typedef char* CTypeNonConst; + using CppType = Glib::ustring; + using CType = const char*; + using CTypeNonConst = char*; static CType to_c_type(const Glib::ustring& str) { return str.c_str(); } static CType to_c_type(const std::string& str) { return str.c_str(); } @@ -289,9 +289,9 @@ struct TypeTraits template <> struct TypeTraits { - typedef std::string CppType; - typedef const char* CType; - typedef char* CTypeNonConst; + using CppType = std::string; + using CType = const char*; + using CTypeNonConst = char*; static CType to_c_type(const std::string& str) { return str.c_str(); } static CType to_c_type(const Glib::ustring& str) { return str.c_str(); } @@ -308,9 +308,9 @@ struct TypeTraits template <> struct TypeTraits { - typedef bool CppType; - typedef gboolean CType; - typedef gboolean CTypeNonConst; + using CppType = bool; + using CType = gboolean; + using CTypeNonConst = gboolean; static CType to_c_type(CppType item) { return static_cast(item); } static CType to_c_type(CType item) { return item; } @@ -324,9 +324,9 @@ struct TypeTraits template <> struct TypeTraits { - typedef Glib::VariantBase CppType; - typedef GVariant* CType; - typedef GVariant* CTypeNonConst; + using CppType = Glib::VariantBase; + using CType = GVariant*; + using CTypeNonConst = GVariant*; static CType to_c_type(const Glib::VariantBase& v) { return const_cast(v.gobj()); } @@ -343,9 +343,9 @@ struct TypeTraits template <> struct TypeTraits { - typedef Glib::VariantContainerBase CppType; - typedef GVariant* CType; - typedef GVariant* CTypeNonConst; + using CppType = Glib::VariantContainerBase; + using CType = GVariant*; + using CTypeNonConst = GVariant*; static CType to_c_type(const Glib::VariantContainerBase& v) { diff --git a/glib/glibmm/containers.h b/glib/glibmm/containers.h index 46b87d09..2382b3c8 100644 --- a/glib/glibmm/containers.h +++ b/glib/glibmm/containers.h @@ -50,9 +50,9 @@ template class List_Iterator_Base { public: - typedef T value_type; - typedef T* pointer; - typedef T& reference; + using value_type = T; + using pointer = T*; + using reference = T&; }; /// For instance, List_Iterator< Gtk::Widget > @@ -60,17 +60,17 @@ template class List_Iterator : public List_Iterator_Base { public: - typedef std::bidirectional_iterator_tag iterator_category; - typedef std::size_t size_type; - typedef std::ptrdiff_t difference_type; + using iterator_category = std::bidirectional_iterator_tag; + using size_type = std::size_t; + using difference_type = std::ptrdiff_t; - typedef typename List_Iterator_Base::pointer pointer; - typedef typename List_Iterator_Base::reference reference; + using pointer = typename List_Iterator_Base::pointer; + using reference = typename List_Iterator_Base::reference; GList* const* head_; GList* node_; - typedef List_Iterator Self; + using Self = List_Iterator; List_Iterator(GList* const& head, GList* node) : head_(&head), node_(node) {} @@ -124,15 +124,15 @@ template class SList_Iterator : public List_Iterator_Base { public: - typedef std::forward_iterator_tag iterator_category; - typedef std::size_t size_type; - typedef std::ptrdiff_t difference_type; + using iterator_category = std::forward_iterator_tag; + using size_type = std::size_t; + using difference_type = std::ptrdiff_t; - typedef typename List_Iterator_Base::pointer pointer; - typedef typename List_Iterator_Base::reference reference; + using pointer = typename List_Iterator_Base::pointer; + using reference = typename List_Iterator_Base::reference; GSList* node_; - typedef SList_Iterator Self; + using Self = SList_Iterator; SList_Iterator(GSList* node) : node_(node) {} @@ -171,14 +171,14 @@ template class List_Cpp_Iterator : public List_Iterator_Base { public: - typedef std::bidirectional_iterator_tag iterator_category; - typedef std::size_t size_type; - typedef std::ptrdiff_t difference_type; + using iterator_category = std::bidirectional_iterator_tag; + using size_type = std::size_t; + using difference_type = std::ptrdiff_t; - typedef typename List_Iterator_Base::pointer pointer; - typedef typename List_Iterator_Base::reference reference; + using pointer = typename List_Iterator_Base::pointer; + using reference = typename List_Iterator_Base::reference; - typedef List_Cpp_Iterator Self; + using Self = List_Cpp_Iterator; GList** head_; GList* node_; @@ -254,15 +254,15 @@ template class List_ReverseIterator : private T_Base { public: - typedef typename T_Base::iterator_category iterator_category; - typedef typename T_Base::size_type size_type; - typedef typename T_Base::difference_type difference_type; + using iterator_category = typename T_Base::iterator_category; + using size_type = typename T_Base::size_type; + using difference_type = typename T_Base::difference_type; - typedef typename T_Base::value_type value_type; - typedef typename T_Base::pointer pointer; - typedef typename T_Base::reference reference; + using value_type = typename T_Base::value_type; + using pointer = typename T_Base::pointer; + using reference = typename T_Base::reference; - typedef List_ReverseIterator Self; + using Self = List_ReverseIterator; bool operator==(const Self& src) const { return T_Base::operator==(src); } bool operator!=(const Self& src) const { return T_Base::operator!=(src); } @@ -306,15 +306,15 @@ template class List_ConstIterator : public T_Base { public: - typedef typename T_Base::iterator_category iterator_category; - typedef typename T_Base::size_type size_type; - typedef typename T_Base::difference_type difference_type; + using iterator_category = typename T_Base::iterator_category; + using size_type = typename T_Base::size_type; + using difference_type = typename T_Base::difference_type; - typedef const typename T_Base::value_type value_type; - typedef const typename T_Base::pointer pointer; - typedef const typename T_Base::reference reference; + using value_type = const typename T_Base::value_type; + using pointer = const typename T_Base::pointer; + using reference = const typename T_Base::reference; - typedef List_ConstIterator Self; + using Self = List_ConstIterator; bool operator==(const Self& src) const { return T_Base::operator==(src); } bool operator!=(const Self& src) const { return T_Base::operator!=(src); } diff --git a/glib/glibmm/error.cc b/glib/glibmm/error.cc index 34ea87a6..09063368 100644 --- a/glib/glibmm/error.cc +++ b/glib/glibmm/error.cc @@ -27,7 +27,7 @@ namespace { -typedef std::map ThrowFuncTable; +using ThrowFuncTable = std::map; static ThrowFuncTable* throw_func_table = nullptr; diff --git a/glib/glibmm/error.h b/glib/glibmm/error.h index 941dc9db..eb61b4e7 100644 --- a/glib/glibmm/error.h +++ b/glib/glibmm/error.h @@ -51,7 +51,7 @@ public: void propagate(GError** dest); - typedef void (*ThrowFunc)(GError*); + using ThrowFunc = void(*)(GError*); static void register_init(); static void register_cleanup(); diff --git a/glib/glibmm/exceptionhandler.cc b/glib/glibmm/exceptionhandler.cc index 60809db9..31ddb39b 100644 --- a/glib/glibmm/exceptionhandler.cc +++ b/glib/glibmm/exceptionhandler.cc @@ -32,7 +32,7 @@ namespace { -typedef sigc::signal HandlerList; +using HandlerList = sigc::signal; // Each thread has its own list of exception handlers // to avoid thread synchronization problems. diff --git a/glib/glibmm/helperlist.h b/glib/glibmm/helperlist.h index 41f1074d..ac0c2a50 100644 --- a/glib/glibmm/helperlist.h +++ b/glib/glibmm/helperlist.h @@ -51,19 +51,19 @@ public: virtual ~HelperList() noexcept {} - typedef T_Child value_type; - typedef value_type& reference; - typedef const value_type& const_reference; + using value_type = T_Child; + using reference = value_type&; + using const_reference = const value_type&; - typedef T_Iterator iterator; - typedef List_ConstIterator const_iterator; - typedef List_ReverseIterator reverse_iterator; - typedef List_ConstIterator const_reverse_iterator; + using iterator = T_Iterator; + using const_iterator = List_ConstIterator; + using reverse_iterator = List_ReverseIterator; + using const_reverse_iterator = List_ConstIterator; - typedef T_CppElement element_type; + using element_type = T_CppElement; - typedef std::size_t difference_type; // TODO Why not std::ptrdiff_t? - typedef std::size_t size_type; + using difference_type = std::size_t; // TODO Why not std::ptrdiff_t? + using size_type = std::size_t; // These are implemented differently for each Helper List. virtual iterator erase(iterator) = 0; diff --git a/glib/glibmm/interface.h b/glib/glibmm/interface.h index c737639b..0b27914e 100644 --- a/glib/glibmm/interface.h +++ b/glib/glibmm/interface.h @@ -35,9 +35,9 @@ class GLIBMM_API Interface : virtual public Glib::ObjectBase { public: #ifndef DOXYGEN_SHOULD_SKIP_THIS - typedef Interface CppObjectType; - typedef Interface_Class CppClassType; - typedef GTypeInterface BaseClassType; + using CppObjectType = Interface; + using CppClassType = Interface_Class; + using BaseClassType = GTypeInterface; #endif /* DOXYGEN_SHOULD_SKIP_THIS */ /** A Default constructor. diff --git a/glib/glibmm/listhandle.h b/glib/glibmm/listhandle.h index 92f9beca..985f9783 100644 --- a/glib/glibmm/listhandle.h +++ b/glib/glibmm/listhandle.h @@ -131,14 +131,14 @@ template class ListHandleIterator { public: - typedef typename Tr::CppType CppType; - typedef typename Tr::CType CType; + using CppType = typename Tr::CppType; + using CType = typename Tr::CType; - typedef std::forward_iterator_tag iterator_category; - typedef CppType value_type; - typedef std::ptrdiff_t difference_type; - typedef value_type reference; - typedef void pointer; + using iterator_category = std::forward_iterator_tag; + using value_type = CppType; + using difference_type = std::ptrdiff_t; + using reference = value_type; + using pointer = void; explicit inline ListHandleIterator(const GList* node); @@ -169,15 +169,15 @@ template > class ListHandle { public: - typedef typename Tr::CppType CppType; - typedef typename Tr::CType CType; + using CppType = typename Tr::CppType; + using CType = typename Tr::CType; - typedef CppType value_type; - typedef std::size_t size_type; - typedef std::ptrdiff_t difference_type; + using value_type = CppType; + using size_type = std::size_t; + using difference_type = std::ptrdiff_t; - typedef Glib::Container_Helpers::ListHandleIterator const_iterator; - typedef Glib::Container_Helpers::ListHandleIterator iterator; + using const_iterator = Glib::Container_Helpers::ListHandleIterator; + using iterator = Glib::Container_Helpers::ListHandleIterator; template inline ListHandle(const Cont& container); diff --git a/glib/glibmm/main.h b/glib/glibmm/main.h index 5bfacbef..f60cc8f0 100644 --- a/glib/glibmm/main.h +++ b/glib/glibmm/main.h @@ -400,8 +400,8 @@ SignalChildWatch signal_child_watch(); class MainContext { public: - typedef Glib::MainContext CppObjectType; - typedef GMainContext BaseObjectType; + using CppObjectType = Glib::MainContext; + using BaseObjectType = GMainContext; // noncopyable MainContext(const MainContext& other) = delete; @@ -624,8 +624,8 @@ Glib::RefPtr wrap(GMainContext* gobject, bool take_copy = false); class MainLoop { public: - typedef Glib::MainLoop CppObjectType; - typedef GMainLoop BaseObjectType; + using CppObjectType = Glib::MainLoop; + using BaseObjectType = GMainLoop; static Glib::RefPtr create(bool is_running = false); static Glib::RefPtr create( @@ -682,8 +682,8 @@ Glib::RefPtr wrap(GMainLoop* gobject, bool take_copy = false); class Source { public: - typedef Glib::Source CppObjectType; - typedef GSource BaseObjectType; + using CppObjectType = Glib::Source; + using BaseObjectType = GSource; // noncopyable Source(const Source&) = delete; @@ -845,7 +845,7 @@ public: class TimeoutSource : public Glib::Source { public: - typedef Glib::TimeoutSource CppObjectType; + using CppObjectType = Glib::TimeoutSource; static Glib::RefPtr create(unsigned int interval); sigc::connection connect(const sigc::slot& slot); @@ -868,7 +868,7 @@ private: class IdleSource : public Glib::Source { public: - typedef Glib::IdleSource CppObjectType; + using CppObjectType = Glib::IdleSource; static Glib::RefPtr create(); sigc::connection connect(const sigc::slot& slot); @@ -885,7 +885,7 @@ protected: class IOSource : public Glib::Source { public: - typedef Glib::IOSource CppObjectType; + using CppObjectType = Glib::IOSource; static Glib::RefPtr create(int fd, IOCondition condition); static Glib::RefPtr create( diff --git a/glib/glibmm/object.h b/glib/glibmm/object.h index 522f84a9..3ff39b03 100644 --- a/glib/glibmm/object.h +++ b/glib/glibmm/object.h @@ -38,8 +38,8 @@ #ifndef DOXYGEN_SHOULD_SKIP_THIS extern "C" { -typedef struct _GObject GObject; -typedef struct _GObjectClass GObjectClass; +using GObject = struct _GObject; +using GObjectClass = struct _GObjectClass; } #endif /* DOXYGEN_SHOULD_SKIP_THIS */ @@ -95,10 +95,10 @@ class GLIBMM_API Object : virtual public ObjectBase { public: #ifndef DOXYGEN_SHOULD_SKIP_THIS - typedef Object CppObjectType; - typedef Object_Class CppClassType; - typedef GObject BaseObjectType; - typedef GObjectClass BaseClassType; + using CppObjectType = Object; + using CppClassType = Object_Class; + using BaseObjectType = GObject; + using BaseClassType = GObjectClass; #endif /* DOXYGEN_SHOULD_SKIP_THIS */ // noncopyable @@ -129,7 +129,7 @@ public: // TODO: Use slots instead: void* get_data(const QueryQuark& key); void set_data(const Quark& key, void* data); - typedef void (*DestroyNotify)(gpointer data); + using DestroyNotify = void (*)(gpointer data); void set_data(const Quark& key, void* data, DestroyNotify notify); void remove_data(const QueryQuark& quark); // same as remove without notifying @@ -171,9 +171,9 @@ namespace Container_Helpers template struct TypeTraits> { - typedef Glib::RefPtr CppType; - typedef typename T::BaseObjectType* CType; - typedef typename T::BaseObjectType* CTypeNonConst; + using CppType = Glib::RefPtr; + using CType = typename T::BaseObjectType*; + using CTypeNonConst = typename T::BaseObjectType*; static CType to_c_type(const CppType& ptr) { return Glib::unwrap(ptr); } static CType to_c_type(CType ptr) { return ptr; } @@ -207,9 +207,9 @@ struct TypeTraits> template struct TypeTraits> { - typedef Glib::RefPtr CppType; - typedef const typename T::BaseObjectType* CType; - typedef typename T::BaseObjectType* CTypeNonConst; + using CppType = Glib::RefPtr; + using CType = const typename T::BaseObjectType*; + using CTypeNonConst = typename T::BaseObjectType*; static CType to_c_type(const CppType& ptr) { return Glib::unwrap(ptr); } static CType to_c_type(CType ptr) { return ptr; } @@ -252,8 +252,8 @@ template class Value> : public ValueBase_Object { public: - typedef Glib::RefPtr CppType; - typedef typename T::BaseObjectType* CType; + using CppType = Glib::RefPtr; + using CType = typename T::BaseObjectType*; static GType value_type() { return T::get_base_type(); } @@ -271,8 +271,8 @@ template class Value> : public ValueBase_Object { public: - typedef Glib::RefPtr CppType; - typedef typename T::BaseObjectType* CType; + using CppType = Glib::RefPtr; + using CType = typename T::BaseObjectType*; static GType value_type() { return T::get_base_type(); } diff --git a/glib/glibmm/objectbase.h b/glib/glibmm/objectbase.h index 7d34bead..cf6a4a03 100644 --- a/glib/glibmm/objectbase.h +++ b/glib/glibmm/objectbase.h @@ -34,7 +34,7 @@ #ifndef DOXYGEN_SHOULD_SKIP_THIS extern "C" { -typedef struct _GObject GObject; +using GObject = struct _GObject; } #endif @@ -229,7 +229,7 @@ protected: Class::interface_class_vector_type custom_interface_classes; }; - typedef std::map extra_object_base_data_type; + using extra_object_base_data_type = std::map; static extra_object_base_data_type extra_object_base_data; // ObjectBase instances may be used in different threads. // Accesses to extra_object_base_data must be thread-safe. diff --git a/glib/glibmm/pattern.h b/glib/glibmm/pattern.h index d588f081..fddec5c3 100644 --- a/glib/glibmm/pattern.h +++ b/glib/glibmm/pattern.h @@ -24,7 +24,7 @@ */ extern "C" { -typedef struct _GPatternSpec GPatternSpec; +using GPatternSpec = struct _GPatternSpec; } #include diff --git a/glib/glibmm/private/interface_p.h b/glib/glibmm/private/interface_p.h index 35963150..a116e0e3 100644 --- a/glib/glibmm/private/interface_p.h +++ b/glib/glibmm/private/interface_p.h @@ -11,8 +11,8 @@ namespace Glib class Interface_Class : public Glib::Class { public: - typedef Interface CppObjectType; - typedef GTypeInterface BaseClassType; + using CppObjectType = Interface; + using BaseClassType = GTypeInterface; void add_interface(GType instance_type) const; }; diff --git a/glib/glibmm/private/object_p.h b/glib/glibmm/private/object_p.h index bcac44df..98ee09b6 100644 --- a/glib/glibmm/private/object_p.h +++ b/glib/glibmm/private/object_p.h @@ -11,9 +11,9 @@ namespace Glib class Object_Class : public Glib::Class { public: - typedef Object CppObjectType; - typedef GObject BaseObjectType; - typedef GObjectClass BaseClassType; + using CppObjectType = Object; + using BaseObjectType = GObject; + using BaseClassType = GObjectClass; static void class_init_function(void* g_class, void* class_data); diff --git a/glib/glibmm/property.h b/glib/glibmm/property.h index 3242bbd7..10769896 100644 --- a/glib/glibmm/property.h +++ b/glib/glibmm/property.h @@ -171,8 +171,8 @@ template class Property : public PropertyBase { public: - typedef T PropertyType; - typedef Glib::Value ValueType; + using PropertyType = T; + using ValueType = Glib::Value; /** Constructs a property of the @a object with the specified @a name. * For each instance of the object, the same property must be constructed with the same name. diff --git a/glib/glibmm/propertyproxy.h b/glib/glibmm/propertyproxy.h index 1d47b3c0..bc274090 100644 --- a/glib/glibmm/propertyproxy.h +++ b/glib/glibmm/propertyproxy.h @@ -44,7 +44,7 @@ template class PropertyProxy : public PropertyProxy_Base { public: - typedef T PropertyType; + using PropertyType = T; PropertyProxy(ObjectBase* obj, const char* name) : PropertyProxy_Base(obj, name) {} @@ -78,7 +78,7 @@ template class PropertyProxy_WriteOnly : public PropertyProxy_Base { public: - typedef T PropertyType; + using PropertyType = T; PropertyProxy_WriteOnly(ObjectBase* obj, const char* name) : PropertyProxy_Base(obj, name) {} @@ -105,7 +105,7 @@ template class PropertyProxy_ReadOnly : public PropertyProxy_Base { public: - typedef T PropertyType; + using PropertyType = T; // obj is const, because this should be returned by const accessors. PropertyProxy_ReadOnly(const ObjectBase* obj, const char* name) diff --git a/glib/glibmm/propertyproxy_base.h b/glib/glibmm/propertyproxy_base.h index e8d62905..fdfb2376 100644 --- a/glib/glibmm/propertyproxy_base.h +++ b/glib/glibmm/propertyproxy_base.h @@ -39,7 +39,7 @@ public: SignalProxyProperty(Glib::ObjectBase* obj, const gchar* property_name); ~SignalProxyProperty() noexcept; - typedef sigc::slot SlotType; + using SlotType = sigc::slot; sigc::connection connect(const SlotType& slot); /** @newin{2,48} */ diff --git a/glib/glibmm/random.h b/glib/glibmm/random.h index d39660f0..d9340449 100644 --- a/glib/glibmm/random.h +++ b/glib/glibmm/random.h @@ -26,7 +26,7 @@ #include extern "C" { -typedef struct _GRand GRand; +using GRand = struct _GRand; } namespace Glib diff --git a/glib/glibmm/refptr.h b/glib/glibmm/refptr.h index c9acef2e..4d8a9c63 100644 --- a/glib/glibmm/refptr.h +++ b/glib/glibmm/refptr.h @@ -60,7 +60,7 @@ private: * T:dont_allow_use_in_glib_refptr_ is a public type, else it's true. * Example: * @code - * typedef int dont_allow_use_in_glib_refptr_; + * using dont_allow_use_in_glib_refptr_ = int; * @endcode */ class is_allowed_type diff --git a/glib/glibmm/sarray.h b/glib/glibmm/sarray.h index 31f139bc..95e2f08f 100644 --- a/glib/glibmm/sarray.h +++ b/glib/glibmm/sarray.h @@ -32,7 +32,7 @@ namespace Glib /** * @deprecated Use a std::vector instead. */ -typedef Glib::ArrayHandle SArray; +using SArray = Glib::ArrayHandle; } #endif // GLIBMM_DISABLE_DEPRECATED diff --git a/glib/glibmm/signalproxy.h b/glib/glibmm/signalproxy.h index 7237be02..458e6b1d 100644 --- a/glib/glibmm/signalproxy.h +++ b/glib/glibmm/signalproxy.h @@ -153,8 +153,8 @@ template class SignalProxy : public SignalProxyNormal { public: - typedef sigc::slot SlotType; - typedef sigc::slot VoidSlotType; + using SlotType = sigc::slot; + using VoidSlotType = sigc::slot; SignalProxy(ObjectBase* obj, const SignalProxyInfo* info) : SignalProxyNormal(obj, info) {} @@ -303,8 +303,8 @@ template class SignalProxyDetailedAnyType : public SignalProxyDetailed { public: - typedef sigc::slot SlotType; - typedef sigc::slot VoidSlotType; + using SlotType = sigc::slot; + using VoidSlotType = sigc::slot; SignalProxyDetailedAnyType( ObjectBase* obj, const SignalProxyInfo* info, const Glib::ustring& detail_name) diff --git a/glib/glibmm/signalproxy_connectionnode.h b/glib/glibmm/signalproxy_connectionnode.h index 1b226ed5..88e98ee5 100644 --- a/glib/glibmm/signalproxy_connectionnode.h +++ b/glib/glibmm/signalproxy_connectionnode.h @@ -24,8 +24,8 @@ #include #ifndef DOXYGEN_SHOULD_SKIP_THIS -typedef struct _GObject GObject; -typedef struct _GClosure GClosure; +using GObject = struct _GObject; +using GClosure = struct _GClosure; #endif // DOXYGEN_SHOULD_SKIP_THIS namespace Glib diff --git a/glib/glibmm/slisthandle.h b/glib/glibmm/slisthandle.h index a9525620..7bf1a9d7 100644 --- a/glib/glibmm/slisthandle.h +++ b/glib/glibmm/slisthandle.h @@ -131,14 +131,14 @@ template class SListHandleIterator { public: - typedef typename Tr::CppType CppType; - typedef typename Tr::CType CType; + using CppType = typename Tr::CppType; + using CType = typename Tr::CType; - typedef std::forward_iterator_tag iterator_category; - typedef CppType value_type; - typedef std::ptrdiff_t difference_type; - typedef value_type reference; - typedef void pointer; + using iterator_category = std::forward_iterator_tag; + using value_type = CppType; + using difference_type = std::ptrdiff_t; + using reference = value_type; + using pointer = void; explicit inline SListHandleIterator(const GSList* node); @@ -168,15 +168,15 @@ template > class SListHandle { public: - typedef typename Tr::CppType CppType; - typedef typename Tr::CType CType; + using CppType = typename Tr::CppType; + using CType = typename Tr::CType; - typedef CppType value_type; - typedef std::size_t size_type; - typedef std::ptrdiff_t difference_type; + using value_type = CppType; + using size_type = std::size_t; + using difference_type = std::ptrdiff_t; - typedef Glib::Container_Helpers::SListHandleIterator const_iterator; - typedef Glib::Container_Helpers::SListHandleIterator iterator; + using const_iterator = Glib::Container_Helpers::SListHandleIterator; + using iterator = Glib::Container_Helpers::SListHandleIterator; template inline SListHandle(const Cont& container); diff --git a/glib/glibmm/threadpool.h b/glib/glibmm/threadpool.h index 6bf4aecd..f75f34d1 100644 --- a/glib/glibmm/threadpool.h +++ b/glib/glibmm/threadpool.h @@ -25,7 +25,7 @@ #include extern "C" { -typedef struct _GThreadPool GThreadPool; +using GThreadPool = struct _GThreadPool; } namespace Glib diff --git a/glib/glibmm/timer.h b/glib/glibmm/timer.h index c99c6022..2559ffa4 100644 --- a/glib/glibmm/timer.h +++ b/glib/glibmm/timer.h @@ -24,7 +24,7 @@ */ extern "C" { -typedef struct _GTimer GTimer; +using GTimer = struct _GTimer; } namespace Glib diff --git a/glib/glibmm/ustring.h b/glib/glibmm/ustring.h index a2076117..cf2ac0dd 100644 --- a/glib/glibmm/ustring.h +++ b/glib/glibmm/ustring.h @@ -39,31 +39,31 @@ namespace Glib template struct IteratorTraits { - typedef typename T::iterator_category iterator_category; - typedef typename T::value_type value_type; - typedef typename T::difference_type difference_type; - typedef typename T::pointer pointer; - typedef typename T::reference reference; + using iterator_category = typename T::iterator_category; + using value_type = typename T::value_type; + using difference_type = typename T::difference_type; + using pointer = typename T::pointer; + using reference = typename T::reference; }; template struct IteratorTraits { - typedef std::random_access_iterator_tag iterator_category; - typedef T value_type; - typedef std::ptrdiff_t difference_type; - typedef T* pointer; - typedef T& reference; + using iterator_category = std::random_access_iterator_tag; + using value_type = T; + using difference_type = std::ptrdiff_t; + using pointer = T*; + using reference = T&; }; template struct IteratorTraits { - typedef std::random_access_iterator_tag iterator_category; - typedef T value_type; - typedef std::ptrdiff_t difference_type; - typedef const T* pointer; - typedef const T& reference; + using iterator_category = std::random_access_iterator_tag; + using value_type = T; + using difference_type = std::ptrdiff_t; + using pointer = const T*; + using reference = const T&; }; #endif /* GLIBMM_HAVE_STD_ITERATOR_TRAITS */ @@ -99,11 +99,11 @@ template class ustring_Iterator { public: - typedef std::bidirectional_iterator_tag iterator_category; - typedef gunichar value_type; - typedef std::string::difference_type difference_type; - typedef value_type reference; - typedef void pointer; + using iterator_category = std::bidirectional_iterator_tag; + using value_type = gunichar; + using difference_type = std::string::difference_type; + using reference = value_type; + using pointer = void; inline ustring_Iterator(); inline ustring_Iterator(const ustring_Iterator& other); @@ -214,20 +214,20 @@ gunichar get_unichar_from_std_iterator(std::string::const_iterator pos) G_GNUC_P class ustring { public: - typedef std::string::size_type size_type; - typedef std::string::difference_type difference_type; + using size_type = std::string::size_type; + using difference_type = std::string::difference_type; - typedef gunichar value_type; - typedef gunichar& reference; - typedef const gunichar& const_reference; + using value_type = gunichar; + using reference = gunichar&; + using const_reference = const gunichar&; - typedef ustring_Iterator iterator; - typedef ustring_Iterator const_iterator; + using iterator = ustring_Iterator; + using const_iterator = ustring_Iterator; #ifndef GLIBMM_HAVE_SUN_REVERSE_ITERATOR - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; + using reverse_iterator = std::reverse_iterator; + using const_reverse_iterator = std::reverse_iterator; #else @@ -863,9 +863,9 @@ public: private: #ifdef GLIBMM_HAVE_WIDE_STREAM - typedef std::wostringstream StreamType; + using StreamType = std::wostringstream; #else - typedef std::ostringstream StreamType; + using StreamType = std::ostringstream; #endif StreamType stream_; diff --git a/glib/glibmm/value.h b/glib/glibmm/value.h index 3a51628d..c7f61af0 100644 --- a/glib/glibmm/value.h +++ b/glib/glibmm/value.h @@ -134,7 +134,7 @@ protected: class ValueBase_Enum : public ValueBase { public: - typedef gint CType; + using CType = gint; static GType value_type() G_GNUC_CONST; #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -152,7 +152,7 @@ protected: class ValueBase_Flags : public ValueBase { public: - typedef guint CType; + using CType = guint; static GType value_type() G_GNUC_CONST; #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -170,7 +170,7 @@ protected: class ValueBase_String : public ValueBase { public: - typedef const gchar* CType; + using CType = const gchar*; static GType value_type() G_GNUC_CONST; #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -200,8 +200,8 @@ template class Value_Boxed : public ValueBase_Boxed { public: - typedef T CppType; - typedef typename T::BaseObjectType* CType; + using CppType = T; + using CType = typename T::BaseObjectType*; static GType value_type() { return T::get_type(); } @@ -219,8 +219,8 @@ template class Value> : public ValueBase_Object { public: - typedef Glib::RefPtr CppType; - typedef typename T::BaseObjectType* CType; + using CppType = Glib::RefPtr; + using CType = typename T::BaseObjectType*; static GType value_type() { return T::get_base_type(); } @@ -238,8 +238,8 @@ template class Value> : public ValueBase_Object { public: - typedef Glib::RefPtr CppType; - typedef typename T::BaseObjectType* CType; + using CppType = Glib::RefPtr; + using CType = typename T::BaseObjectType*; static GType value_type() { return T::get_base_type(); } @@ -268,7 +268,7 @@ template <> class Value : public ValueBase_String { public: - typedef std::string CppType; + using CppType = std::string; void set(const std::string& data); std::string get() const { return get_cstring(); } @@ -281,7 +281,7 @@ template <> class Value : public ValueBase_String { public: - typedef Glib::ustring CppType; + using CppType = Glib::ustring; void set(const Glib::ustring& data); Glib::ustring get() const { return get_cstring(); } @@ -294,7 +294,7 @@ template class Value_Enum : public ValueBase_Enum { public: - typedef T CppType; + using CppType = T; void set(CppType data) { set_enum(data); } CppType get() const { return CppType(get_enum()); } @@ -307,7 +307,7 @@ template class Value_Flags : public ValueBase_Flags { public: - typedef T CppType; + using CppType = T; void set(CppType data) { set_flags(data); } CppType get() const { return CppType(get_flags()); } diff --git a/glib/glibmm/value_custom.h b/glib/glibmm/value_custom.h index f94bf1b4..d3ebfee0 100644 --- a/glib/glibmm/value_custom.h +++ b/glib/glibmm/value_custom.h @@ -61,8 +61,8 @@ template class Value_Pointer : public ValueBase_Object { public: - typedef PtrT CppType; - typedef void* CType; + using CppType = PtrT; + using CType = void*; static inline GType value_type() G_GNUC_CONST; @@ -100,8 +100,8 @@ template class Value : public ValueBase_Boxed { public: - typedef T CppType; - typedef T* CType; + using CppType = T; + using CType = T*; static GType value_type() G_GNUC_CONST; diff --git a/glib/glibmm/vectorutils.h b/glib/glibmm/vectorutils.h index 40231dbe..6ea434ae 100644 --- a/glib/glibmm/vectorutils.h +++ b/glib/glibmm/vectorutils.h @@ -93,7 +93,7 @@ template typename Tr::CType* create_array(typename std::vector::const_iterator pbegin, std::size_t size) { - typedef typename Tr::CType CType; + using CType = typename Tr::CType; CType* const array(static_cast(g_malloc((size + 1) * sizeof(CType)))); CType* const array_end(array + size); @@ -160,14 +160,14 @@ template class ArrayIterator { public: - typedef typename Tr::CppType CppType; - typedef typename Tr::CType CType; + using CppType = typename Tr::CppType; + using CType = typename Tr::CType; - typedef std::random_access_iterator_tag iterator_category; - typedef CppType value_type; - typedef std::ptrdiff_t difference_type; - typedef value_type reference; - typedef void pointer; + using iterator_category = std::random_access_iterator_tag; + using value_type = CppType; + using difference_type = std::ptrdiff_t; + using reference = value_type; + using pointer = void; explicit inline ArrayIterator(const CType* pos); @@ -201,14 +201,14 @@ template class ListIterator { public: - typedef typename Tr::CppType CppType; - typedef typename Tr::CType CType; + using CppType = typename Tr::CppType; + using CType = typename Tr::CType; - typedef std::forward_iterator_tag iterator_category; - typedef CppType value_type; - typedef std::ptrdiff_t difference_type; - typedef value_type reference; - typedef void pointer; + using iterator_category = std::forward_iterator_tag; + using value_type = CppType; + using difference_type = std::ptrdiff_t; + using reference = value_type; + using pointer = void; explicit inline ListIterator(const GList* node); @@ -227,14 +227,14 @@ template class SListIterator { public: - typedef typename Tr::CppType CppType; - typedef typename Tr::CType CType; + using CppType = typename Tr::CppType; + using CType = typename Tr::CType; - typedef std::forward_iterator_tag iterator_category; - typedef CppType value_type; - typedef std::ptrdiff_t difference_type; - typedef value_type reference; - typedef void pointer; + using iterator_category = std::forward_iterator_tag; + using value_type = CppType; + using difference_type = std::ptrdiff_t; + using reference = value_type; + using pointer = void; explicit inline SListIterator(const GSList* node); @@ -275,8 +275,8 @@ template class ArrayKeeper { public: - typedef typename Tr::CppType CppType; - typedef typename Tr::CType CType; + using CppType = typename Tr::CppType; + using CType = typename Tr::CType; /** Constructs an ArrayKeeper holding @a array of size @a array_size. * @a ownership tells what should be destroyed with keeper destruction: @@ -335,8 +335,8 @@ template class GListKeeper { public: - typedef typename Tr::CppType CppType; - typedef typename Tr::CType CType; + using CppType = typename Tr::CppType; + using CType = typename Tr::CType; /** Constructs an GListKeeper holding @a glist. * @a ownership tells what should be destroyed with keeper destruction: @@ -392,8 +392,8 @@ template class GSListKeeper { public: - typedef typename Tr::CppType CppType; - typedef typename Tr::CType CType; + using CppType = typename Tr::CppType; + using CType = typename Tr::CType; /** Constructs an GSListKeeper holding @a gslist. * @a ownership tells what should be destroyed with keeper destruction: @@ -467,11 +467,11 @@ template > class ArrayHandler { public: - typedef typename Tr::CType CType; - typedef T CppType; - typedef std::vector VectorType; - typedef typename Glib::Container_Helpers::ArrayKeeper ArrayKeeperType; - typedef typename Glib::Container_Helpers::ArrayIterator ArrayIteratorType; + using CType = typename Tr::CType; + using CppType = T; + using VectorType = std::vector; + using ArrayKeeperType = typename Glib::Container_Helpers::ArrayKeeper; + using ArrayIteratorType = typename Glib::Container_Helpers::ArrayIterator; // maybe think about using C++0x move constructors? static VectorType array_to_vector( @@ -484,9 +484,9 @@ template <> class ArrayHandler { public: - typedef gboolean CType; - typedef bool CppType; - typedef std::vector VectorType; + using CType = gboolean; + using CppType = bool; + using VectorType = std::vector; typedef Glib::Container_Helpers::ArrayKeeper> ArrayKeeperType; typedef Glib::Container_Helpers::ArrayIterator> @@ -530,11 +530,11 @@ template > class ListHandler { public: - typedef typename Tr::CType CType; - typedef T CppType; - typedef std::vector VectorType; - typedef typename Glib::Container_Helpers::GListKeeper GListKeeperType; - typedef typename Glib::Container_Helpers::ListIterator ListIteratorType; + using CType = typename Tr::CType; + using CppType = T; + using VectorType = std::vector; + using GListKeeperType = typename Glib::Container_Helpers::GListKeeper; + using ListIteratorType = typename Glib::Container_Helpers::ListIterator; // maybe think about using C++0x move constructors? static VectorType list_to_vector(GList* glist, Glib::OwnershipType ownership); @@ -571,11 +571,11 @@ template > class SListHandler { public: - typedef typename Tr::CType CType; - typedef T CppType; - typedef std::vector VectorType; - typedef typename Glib::Container_Helpers::GSListKeeper GSListKeeperType; - typedef typename Glib::Container_Helpers::SListIterator SListIteratorType; + using CType = typename Tr::CType; + using CppType = T; + using VectorType = std::vector; + using GSListKeeperType = typename Glib::Container_Helpers::GSListKeeper; + using SListIteratorType = typename Glib::Container_Helpers::SListIterator; // maybe think about using C++0x move constructors? static VectorType slist_to_vector(GSList* gslist, Glib::OwnershipType ownership); @@ -847,7 +847,7 @@ inline GListKeeper::GListKeeper(const GListKeeper& keeper) template GListKeeper::~GListKeeper() noexcept { - typedef typename Tr::CTypeNonConst CTypeNonConst; + using CTypeNonConst = typename Tr::CTypeNonConst; if (glist_ && ownership_ != Glib::OWNERSHIP_NONE) { @@ -888,7 +888,7 @@ inline GSListKeeper::GSListKeeper(const GSListKeeper& keeper) template GSListKeeper::~GSListKeeper() noexcept { - typedef typename Tr::CTypeNonConst CTypeNonConst; + using CTypeNonConst = typename Tr::CTypeNonConst; if (gslist_ && ownership_ != Glib::OWNERSHIP_NONE) { if (ownership_ != Glib::OWNERSHIP_SHALLOW) diff --git a/glib/glibmm/wrap.cc b/glib/glibmm/wrap.cc index 67861d61..f30fea95 100644 --- a/glib/glibmm/wrap.cc +++ b/glib/glibmm/wrap.cc @@ -36,7 +36,7 @@ namespace // on any platform. Nevertheless, indexing a vector costs almost nothing // compared to a map lookup. -typedef std::vector WrapFuncTable; +using WrapFuncTable = std::vector; static WrapFuncTable* wrap_func_table = nullptr; diff --git a/glib/glibmm/wrap.h b/glib/glibmm/wrap.h index 36dff859..eec39bbd 100644 --- a/glib/glibmm/wrap.h +++ b/glib/glibmm/wrap.h @@ -31,7 +31,7 @@ class ObjectBase; class Object; // Type of the per-class wrap_new() functions. -typedef Glib::ObjectBase* (*WrapNewFunction)(GObject*); +using WrapNewFunction = Glib::ObjectBase*(*)(GObject*); // Setup and free the structures used by wrap_register(). // Both functions might be called more than once. diff --git a/tests/glibmm_btree/main.cc b/tests/glibmm_btree/main.cc index 647542b8..dbe0f851 100644 --- a/tests/glibmm_btree/main.cc +++ b/tests/glibmm_btree/main.cc @@ -1,7 +1,7 @@ #include -typedef Glib::ustring type_key_value; -typedef type_key_value* type_p_key_value; +using type_key_value = Glib::ustring; +using type_p_key_value = type_key_value*; static int my_search(const type_key_value& key_a, const type_key_value& key_b) diff --git a/tests/glibmm_interface_move/main.cc b/tests/glibmm_interface_move/main.cc index 99dbd584..c097cbb5 100644 --- a/tests/glibmm_interface_move/main.cc +++ b/tests/glibmm_interface_move/main.cc @@ -80,7 +80,7 @@ class TestInterface; class TestInterface_Class : public Glib::Interface_Class { public: - typedef TestInterface BaseClassType; + using BaseClassType = TestInterface; friend class TestInterface; @@ -107,7 +107,7 @@ public: class TestInterface : public Glib::Interface { protected: - typedef TestInterface_Class CppClassType; + using CppClassType = TestInterface_Class; TestInterface() : Glib::Interface(derived_interface_class_.init()) {} @@ -147,8 +147,8 @@ private: class DerivedObject_Class : public Glib::Class { public: - typedef GObjectClass BaseClassType; - typedef Glib::Object_Class CppClassParent; + using BaseClassType = GObjectClass; + using CppClassParent = Glib::Object_Class; static void class_init_function(void* g_class, void* class_data) { @@ -183,7 +183,7 @@ TestInterface::CppClassType TestInterface::derived_interface_class_; // initiali class DerivedObject : public Glib::Object, public TestInterface { public: - typedef DerivedObject_Class CppClassType; + using CppClassType = DerivedObject_Class; // A real application would never make the constructor public. // It would instead have a protected constructor and a public create() method. diff --git a/tests/glibmm_nodetree/main.cc b/tests/glibmm_nodetree/main.cc index fffdafa4..0554c489 100644 --- a/tests/glibmm_nodetree/main.cc +++ b/tests/glibmm_nodetree/main.cc @@ -1,7 +1,7 @@ #include #include -typedef Glib::NodeTree type_nodetree_string; +using type_nodetree_string = Glib::NodeTree; static bool node_build_string(type_nodetree_string& node, std::string& string) diff --git a/tests/glibmm_null_containerhandle/main.cc b/tests/glibmm_null_containerhandle/main.cc index 33533706..80d83506 100644 --- a/tests/glibmm_null_containerhandle/main.cc +++ b/tests/glibmm_null_containerhandle/main.cc @@ -26,7 +26,7 @@ int main() { Gio::init(); - typedef Glib::RefPtr CrePtr; + using CrePtr = Glib::RefPtr; std::vector v1(Glib::ArrayHandle(nullptr, Glib::OWNERSHIP_DEEP)); std::vector v2(Glib::ArrayHandle(nullptr, 5, Glib::OWNERSHIP_DEEP)); diff --git a/tests/glibmm_null_vectorutils/main.cc b/tests/glibmm_null_vectorutils/main.cc index a686adee..b658b391 100644 --- a/tests/glibmm_null_vectorutils/main.cc +++ b/tests/glibmm_null_vectorutils/main.cc @@ -24,7 +24,7 @@ int main() { Gio::init(); - typedef Glib::RefPtr CrePtr; + using CrePtr = Glib::RefPtr; std::vector v1( Glib::ArrayHandler::array_to_vector(nullptr, Glib::OWNERSHIP_DEEP)); diff --git a/tests/glibmm_variant/main.cc b/tests/glibmm_variant/main.cc index e5877a87..8ac5d50e 100644 --- a/tests/glibmm_variant/main.cc +++ b/tests/glibmm_variant/main.cc @@ -52,7 +52,7 @@ main(int, char**) // Dict: - typedef std::pair TypeDictEntry; + using TypeDictEntry = std::pair; TypeDictEntry dict_entry("A key", "A value"); @@ -68,7 +68,7 @@ main(int, char**) ostr << std::endl; - typedef std::map TypeDict; + using TypeDict = std::map; TypeDict orig_dict; @@ -112,7 +112,7 @@ main(int, char**) } // std::vector< std::map< Glib::ustring, Glib::Variant > > - typedef std::map> ComplexDictType; + using ComplexDictType = std::map>; ComplexDictType complex_dict1; ComplexDictType complex_dict2; @@ -132,7 +132,7 @@ main(int, char**) complex_dict2.insert(std::pair>("Map 2 " + s, v)); } - typedef std::vector>> ComplexVecType; + using ComplexVecType = std::vector>>; ComplexVecType complex_vector = { complex_dict1, complex_dict2 }; @@ -275,7 +275,7 @@ test_dynamic_cast_composite_types() try { - typedef std::map> composite_type; + using composite_type = std::map>; auto derived = Glib::VariantBase::cast_dynamic>(cppdict); ostr << "Cast composite type (get_type_string()=" << derived.get_type_string() @@ -352,8 +352,8 @@ test_dynamic_cast() } // A variant of type a{sv} - typedef std::map type_map_sv; - typedef Glib::Variant type_dict_sv; + using type_map_sv = std::map; + using type_dict_sv = Glib::Variant; g_assert((type_dict_sv::variant_type().get_string()) == "a{sv}"); type_dict_sv var_map; diff --git a/tools/extra_defs_gen/generate_extra_defs.h b/tools/extra_defs_gen/generate_extra_defs.h index dc952621..9d960e3e 100644 --- a/tools/extra_defs_gen/generate_extra_defs.h +++ b/tools/extra_defs_gen/generate_extra_defs.h @@ -26,7 +26,7 @@ /** Function pointer type for functions that determine if a GType is a pointer * type. */ -typedef bool (*GTypeIsAPointerFunc)(GType gtype); +using GTypeIsAPointerFunc = bool(*)(GType gtype); /** Default extra defs utility function to determine if a GType is a pointer * type. -- cgit v1.2.1