Modernize: Use "using" instead of "typedef" (#754)

This commit is contained in:
Andy Maloney
2019-10-02 12:14:49 -04:00
committed by Jesse Beder
parent 0fddd1e5bd
commit 6e87b37034
18 changed files with 44 additions and 44 deletions

View File

@@ -66,7 +66,7 @@ static const unsigned char decoding[] = {
};
std::vector<unsigned char> DecodeBase64(const std::string &input) {
typedef std::vector<unsigned char> ret_type;
using ret_type = std::vector<unsigned char>;
if (input.empty())
return ret_type();

View File

@@ -61,11 +61,11 @@ class NodeBuilder : public EventHandler {
detail::shared_memory_holder m_pMemory;
detail::node* m_pRoot;
typedef std::vector<detail::node*> Nodes;
using Nodes = std::vector<detail::node *>;
Nodes m_stack;
Nodes m_anchors;
typedef std::pair<detail::node*, bool> PushedKey;
using PushedKey = std::pair<detail::node*, bool>;
std::vector<PushedKey> m_keys;
std::size_t m_mapDepth;
};

View File

@@ -45,7 +45,7 @@ class NodeEvents {
anchor_t _CreateNewAnchor() { return ++m_curAnchor; }
private:
typedef std::map<const detail::node_ref*, anchor_t> AnchorByIdentity;
using AnchorByIdentity = std::map<const detail::node_ref*, anchor_t>;
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<const detail::node_ref*, int> RefCount;
using RefCount = std::map<const detail::node_ref*, int>;
RefCount m_refCount;
};
} // namespace YAML

View File

@@ -95,7 +95,7 @@ class SettingChanges {
}
private:
typedef std::vector<std::unique_ptr<SettingChangeBase>> setting_changes;
using setting_changes = std::vector<std::unique_ptr<SettingChangeBase> >;
setting_changes m_settingChanges;
};
} // namespace YAML

View File

@@ -59,7 +59,7 @@ class SingleDocParser {
const Directives& m_directives;
std::unique_ptr<CollectionStack> m_pCollectionStack;
typedef std::map<std::string, anchor_t> Anchors;
using Anchors = std::map<std::string, anchor_t>;
Anchors m_anchors;
anchor_t m_curAnchor;

View File

@@ -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;