[libxml++] Use using instead of typedef



commit a1d74cf2b60d17791220c133107fc46ad6f75613
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Sat Jan 2 10:42:32 2016 +0100

    Use using instead of typedef
    
    * libxml++/document.cc:
    * libxml++/nodes/element.h:
    * libxml++/nodes/node.h:
    * libxml++/parsers/parser.h:
    * libxml++/parsers/saxparser.h:
    * libxml++/parsers/textreader.h: Use using newtypename = oldtype instead of
    typedef oldtype newtypename. This is the recommended way of declaring
    type name aliases in C++11.

 libxml++/document.cc          |    2 +-
 libxml++/nodes/element.h      |    4 ++--
 libxml++/nodes/node.h         |   10 +++++-----
 libxml++/parsers/parser.h     |    2 +-
 libxml++/parsers/saxparser.h  |    2 +-
 libxml++/parsers/textreader.h |    2 +-
 6 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/libxml++/document.cc b/libxml++/document.cc
index 5de36c0..692a4a7 100644
--- a/libxml++/document.cc
+++ b/libxml++/document.cc
@@ -23,7 +23,7 @@
 
 namespace // anonymous
 {
-typedef std::map<xmlpp::Node*, xmlElementType> NodeMap;
+using NodeMap = std::map<xmlpp::Node*, xmlElementType>;
 
 // Find all C++ wrappers of 'node' and its descendants.
 // Compare xmlpp::Node::free_wrappers().
diff --git a/libxml++/nodes/element.h b/libxml++/nodes/element.h
index e013828..e29264b 100644
--- a/libxml++/nodes/element.h
+++ b/libxml++/nodes/element.h
@@ -26,8 +26,8 @@ public:
   explicit Element(_xmlNode* node);
   ~Element() override;
 
-  typedef std::list<Attribute*> AttributeList;
-  typedef std::list<const Attribute*> const_AttributeList;
+  using AttributeList = std::list<Attribute*>;
+  using const_AttributeList = std::list<const Attribute*>;
 
   /** Add a namespace declaration to this node which will apply to this node and all children.
    *
diff --git a/libxml++/nodes/node.h b/libxml++/nodes/node.h
index 53ea51e..f53e0b8 100644
--- a/libxml++/nodes/node.h
+++ b/libxml++/nodes/node.h
@@ -51,11 +51,11 @@ enum class XPathResultType
 class Node : public NonCopyable
 {
 public:
-  typedef std::list<Node*> NodeList;
-  typedef std::list<const Node*> const_NodeList;
+  using NodeList = std::list<Node*>;
+  using const_NodeList = std::list<const Node*>;
 
-  typedef std::vector<Node*> NodeSet;
-  typedef std::vector<const Node*> const_NodeSet;
+  using NodeSet = std::vector<Node*>;
+  using const_NodeSet = std::vector<const Node*>;
 
   /** @throws xmlpp::internal_error If @a node is <tt>nullptr</tt>.
    */
@@ -210,7 +210,7 @@ public:
 
   /** A map of namespace prefixes to namespace URIs.
    */
-  typedef std::map<Glib::ustring, Glib::ustring> PrefixNsMap;
+  using PrefixNsMap = std::map<Glib::ustring, Glib::ustring>;
 
   /** Find nodes from an XPath expression.
    * @param xpath The XPath of the nodes.
diff --git a/libxml++/parsers/parser.h b/libxml++/parsers/parser.h
index b0d842d..d295342 100644
--- a/libxml++/parsers/parser.h
+++ b/libxml++/parsers/parser.h
@@ -38,7 +38,7 @@ public:
   Parser();
   ~Parser() override;
 
-  typedef unsigned int size_type;
+  using size_type = unsigned int;
 
   /** By default, the parser will not validate the XML file.
    * @param val Whether the document should be validated.
diff --git a/libxml++/parsers/saxparser.h b/libxml++/parsers/saxparser.h
index 0fe462d..ba3be62 100644
--- a/libxml++/parsers/saxparser.h
+++ b/libxml++/parsers/saxparser.h
@@ -49,7 +49,7 @@ public:
       }
   };
 
-  typedef std::deque< Attribute > AttributeList;
+  using AttributeList = std::deque<Attribute>;
 
   /** This functor is a helper to find an attribute by name in an
    * AttributeList using the standard algorithm std::find_if
diff --git a/libxml++/parsers/textreader.h b/libxml++/parsers/textreader.h
index 2cd34e6..c8b44a7 100644
--- a/libxml++/parsers/textreader.h
+++ b/libxml++/parsers/textreader.h
@@ -77,7 +77,7 @@ class TextReader: public NonCopyable
       SubstEntities = 4
     };
 
-  typedef unsigned int size_type;
+  using size_type = unsigned int;
 
   public:
     /**


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