diff --git a/include/yaml-cpp/anchor.h b/include/yaml-cpp/anchor.h index 06759c7..f46d1d7 100644 --- a/include/yaml-cpp/anchor.h +++ b/include/yaml-cpp/anchor.h @@ -10,7 +10,7 @@ #include namespace YAML { -typedef std::size_t anchor_t; +using anchor_t = std::size_t; const anchor_t NullAnchor = 0; } diff --git a/include/yaml-cpp/node/detail/bool_type.h b/include/yaml-cpp/node/detail/bool_type.h index 2c80705..5bd23e9 100644 --- a/include/yaml-cpp/node/detail/bool_type.h +++ b/include/yaml-cpp/node/detail/bool_type.h @@ -13,7 +13,7 @@ struct unspecified_bool { struct NOT_ALLOWED; static void true_value(NOT_ALLOWED*) {} }; -typedef void (*unspecified_bool_type)(unspecified_bool::NOT_ALLOWED*); +using unspecified_bool_type = void (*)(unspecified_bool::NOT_ALLOWED *); } } diff --git a/include/yaml-cpp/node/detail/iterator.h b/include/yaml-cpp/node/detail/iterator.h index 966107d..997c69a 100644 --- a/include/yaml-cpp/node/detail/iterator.h +++ b/include/yaml-cpp/node/detail/iterator.h @@ -26,7 +26,7 @@ class iterator_base { template friend class iterator_base; struct enabler {}; - typedef node_iterator base_type; + using base_type = node_iterator; struct proxy { explicit proxy(const V& x) : m_ref(x) {} diff --git a/include/yaml-cpp/node/detail/iterator_fwd.h b/include/yaml-cpp/node/detail/iterator_fwd.h index 5f1ffe7..75c9de0 100644 --- a/include/yaml-cpp/node/detail/iterator_fwd.h +++ b/include/yaml-cpp/node/detail/iterator_fwd.h @@ -20,8 +20,8 @@ template class iterator_base; } -typedef detail::iterator_base iterator; -typedef detail::iterator_base const_iterator; +using iterator = detail::iterator_base; +using const_iterator = detail::iterator_base; } #endif // VALUE_DETAIL_ITERATOR_FWD_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/include/yaml-cpp/node/detail/memory.h b/include/yaml-cpp/node/detail/memory.h index a4df0f7..e881545 100644 --- a/include/yaml-cpp/node/detail/memory.h +++ b/include/yaml-cpp/node/detail/memory.h @@ -27,7 +27,7 @@ class YAML_CPP_API memory { void merge(const memory& rhs); private: - typedef std::set Nodes; + using Nodes = std::set; Nodes m_nodes; }; diff --git a/include/yaml-cpp/node/detail/node.h b/include/yaml-cpp/node/detail/node.h index a2cc52b..4d96b5c 100644 --- a/include/yaml-cpp/node/detail/node.h +++ b/include/yaml-cpp/node/detail/node.h @@ -160,7 +160,7 @@ class node { private: shared_node_ref m_pRef; - typedef std::set nodes; + using nodes = std::set; nodes m_dependencies; }; } // namespace detail diff --git a/include/yaml-cpp/node/detail/node_data.h b/include/yaml-cpp/node/detail/node_data.h index 82fb79a..065df4b 100644 --- a/include/yaml-cpp/node/detail/node_data.h +++ b/include/yaml-cpp/node/detail/node_data.h @@ -108,17 +108,17 @@ class YAML_CPP_API node_data { std::string m_scalar; // sequence - typedef std::vector node_seq; + using node_seq = std::vector; node_seq m_sequence; mutable std::size_t m_seqSize; // map - typedef std::vector> node_map; + using node_map = std::vector>; node_map m_map; - typedef std::pair kv_pair; - typedef std::list kv_pairs; + using kv_pair = std::pair; + using kv_pairs = std::list; mutable kv_pairs m_undefinedPairs; }; } diff --git a/include/yaml-cpp/node/detail/node_iterator.h b/include/yaml-cpp/node/detail/node_iterator.h index ab6916f..43273c1 100644 --- a/include/yaml-cpp/node/detail/node_iterator.h +++ b/include/yaml-cpp/node/detail/node_iterator.h @@ -24,7 +24,7 @@ struct iterator_type { template struct node_iterator_value : public std::pair { - typedef std::pair kv; + using kv = std::pair; node_iterator_value() : kv(), pNode(nullptr) {} explicit node_iterator_value(V& rhs) : kv(), pNode(&rhs) {} @@ -36,19 +36,19 @@ struct node_iterator_value : public std::pair { V* pNode; }; -typedef std::vector node_seq; -typedef std::vector> node_map; +using node_seq = std::vector; +using node_map = std::vector>; template struct node_iterator_type { - typedef node_seq::iterator seq; - typedef node_map::iterator map; + using seq = node_seq::iterator; + using map = node_map::iterator; }; template struct node_iterator_type { - typedef node_seq::const_iterator seq; - typedef node_map::const_iterator map; + using seq = node_seq::const_iterator; + using map = node_map::const_iterator; }; template @@ -68,9 +68,9 @@ class node_iterator_base }; public: - typedef typename node_iterator_type::seq SeqIter; - typedef typename node_iterator_type::map MapIter; - typedef node_iterator_value value_type; + using SeqIter = typename node_iterator_type::seq; + using MapIter = typename node_iterator_type::map; + using value_type = node_iterator_value; node_iterator_base() : m_type(iterator_type::NoneType), m_seqIt(), m_mapIt(), m_mapEnd() {} @@ -172,8 +172,8 @@ class node_iterator_base MapIter m_mapIt, m_mapEnd; }; -typedef node_iterator_base node_iterator; -typedef node_iterator_base const_node_iterator; +using node_iterator = node_iterator_base; +using const_node_iterator = node_iterator_base; } } diff --git a/include/yaml-cpp/node/impl.h b/include/yaml-cpp/node/impl.h index e59505d..f2f1f69 100644 --- a/include/yaml-cpp/node/impl.h +++ b/include/yaml-cpp/node/impl.h @@ -335,7 +335,7 @@ template struct to_value_t { explicit to_value_t(const T& t_) : t(t_) {} const T& t; - typedef const T& return_type; + using return_type = const T &; const T& operator()() const { return t; } }; @@ -344,7 +344,7 @@ template <> struct to_value_t { explicit to_value_t(const char* t_) : t(t_) {} const char* t; - typedef std::string return_type; + using return_type = std::string; const std::string operator()() const { return t; } }; @@ -353,7 +353,7 @@ template <> struct to_value_t { explicit to_value_t(char* t_) : t(t_) {} const char* t; - typedef std::string return_type; + using return_type = std::string; const std::string operator()() const { return t; } }; @@ -362,7 +362,7 @@ template struct to_value_t { explicit to_value_t(const char* t_) : t(t_) {} const char* t; - typedef std::string return_type; + using return_type = std::string; const std::string operator()() const { return t; } }; diff --git a/include/yaml-cpp/node/node.h b/include/yaml-cpp/node/node.h index 49af58e..6167213 100644 --- a/include/yaml-cpp/node/node.h +++ b/include/yaml-cpp/node/node.h @@ -39,8 +39,8 @@ class YAML_CPP_API Node { template friend struct as_if; - typedef YAML::iterator iterator; - typedef YAML::const_iterator const_iterator; + using iterator = YAML::iterator; + using const_iterator = YAML::const_iterator; Node(); explicit Node(NodeType::value type); diff --git a/include/yaml-cpp/node/ptr.h b/include/yaml-cpp/node/ptr.h index ce085dd..062d77e 100644 --- a/include/yaml-cpp/node/ptr.h +++ b/include/yaml-cpp/node/ptr.h @@ -18,11 +18,11 @@ class node_data; class memory; class memory_holder; -typedef std::shared_ptr shared_node; -typedef std::shared_ptr shared_node_ref; -typedef std::shared_ptr shared_node_data; -typedef std::shared_ptr shared_memory_holder; -typedef std::shared_ptr shared_memory; +using shared_node = std::shared_ptr; +using shared_node_ref = std::shared_ptr; +using shared_node_data = std::shared_ptr; +using shared_memory_holder = std::shared_ptr; +using shared_memory = std::shared_ptr; } } diff --git a/include/yaml-cpp/traits.h b/include/yaml-cpp/traits.h index 36d406b..9a62db2 100644 --- a/include/yaml-cpp/traits.h +++ b/include/yaml-cpp/traits.h @@ -84,7 +84,7 @@ struct is_numeric { template struct enable_if_c { - typedef T type; + using type = T; }; template @@ -95,7 +95,7 @@ struct enable_if : public enable_if_c {}; template struct disable_if_c { - typedef T type; + using type = T; }; template diff --git a/src/binary.cpp b/src/binary.cpp index 4db6d0b..306ed0e 100644 --- a/src/binary.cpp +++ b/src/binary.cpp @@ -66,7 +66,7 @@ static const unsigned char decoding[] = { }; std::vector DecodeBase64(const std::string &input) { - typedef std::vector ret_type; + using ret_type = std::vector; if (input.empty()) return ret_type(); diff --git a/src/nodebuilder.h b/src/nodebuilder.h index 506eefe..c580d40 100644 --- a/src/nodebuilder.h +++ b/src/nodebuilder.h @@ -61,11 +61,11 @@ class NodeBuilder : public EventHandler { detail::shared_memory_holder m_pMemory; detail::node* m_pRoot; - typedef std::vector Nodes; + using Nodes = std::vector; Nodes m_stack; Nodes m_anchors; - typedef std::pair PushedKey; + using PushedKey = std::pair; std::vector m_keys; std::size_t m_mapDepth; }; diff --git a/src/nodeevents.h b/src/nodeevents.h index dbed5d2..efca914 100644 --- a/src/nodeevents.h +++ b/src/nodeevents.h @@ -45,7 +45,7 @@ class NodeEvents { anchor_t _CreateNewAnchor() { return ++m_curAnchor; } private: - typedef std::map AnchorByIdentity; + using AnchorByIdentity = std::map; AnchorByIdentity m_anchorByIdentity; anchor_t m_curAnchor; @@ -60,7 +60,7 @@ class NodeEvents { detail::shared_memory_holder m_pMemory; detail::node* m_root; - typedef std::map RefCount; + using RefCount = std::map; RefCount m_refCount; }; } // namespace YAML diff --git a/src/setting.h b/src/setting.h index ead1c78..4dd6aad 100644 --- a/src/setting.h +++ b/src/setting.h @@ -95,7 +95,7 @@ class SettingChanges { } private: - typedef std::vector> setting_changes; + using setting_changes = std::vector >; setting_changes m_settingChanges; }; } // namespace YAML diff --git a/src/singledocparser.h b/src/singledocparser.h index 392453e..c8cfca9 100644 --- a/src/singledocparser.h +++ b/src/singledocparser.h @@ -59,7 +59,7 @@ class SingleDocParser { const Directives& m_directives; std::unique_ptr m_pCollectionStack; - typedef std::map Anchors; + using Anchors = std::map; Anchors m_anchors; anchor_t m_curAnchor; diff --git a/src/stream.cpp b/src/stream.cpp index 592802d..8c40c08 100644 --- a/src/stream.cpp +++ b/src/stream.cpp @@ -189,7 +189,7 @@ Stream::Stream(std::istream& input) m_pPrefetched(new unsigned char[YAML_PREFETCH_SIZE]), m_nPrefetchedAvailable(0), m_nPrefetchedUsed(0) { - typedef std::istream::traits_type char_traits; + using char_traits = std::istream::traits_type; if (!input) return;