summaryrefslogtreecommitdiff
path: root/src/support
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2022-11-15 10:02:27 -0800
committerGitHub <noreply@github.com>2022-11-15 18:02:27 +0000
commit59cbdd818dc3397a823a37e9821fd32f4522b2fc (patch)
tree58470bfc11591d2e70f1b79645061c1a23beb75d /src/support
parent236f12f7df64f10e1238bf2d66b1216f700b15df (diff)
downloadbinaryen-59cbdd818dc3397a823a37e9821fd32f4522b2fc.tar.gz
binaryen-59cbdd818dc3397a823a37e9821fd32f4522b2fc.tar.bz2
binaryen-59cbdd818dc3397a823a37e9821fd32f4522b2fc.zip
Switch from `typedef` to `using` in C++ code. NFC (#5258)
This is more modern and (IMHO) easier to read than that old C typedef syntax.
Diffstat (limited to 'src/support')
-rw-r--r--src/support/insert_ordered.h4
-rw-r--r--src/support/json.h6
-rw-r--r--src/support/small_vector.h6
3 files changed, 8 insertions, 8 deletions
diff --git a/src/support/insert_ordered.h b/src/support/insert_ordered.h
index 6b0f54968..1460c4329 100644
--- a/src/support/insert_ordered.h
+++ b/src/support/insert_ordered.h
@@ -32,7 +32,7 @@ template<typename T> struct InsertOrderedSet {
std::unordered_map<T, typename std::list<T>::iterator> Map;
std::list<T> List;
- typedef typename std::list<T>::iterator iterator;
+ using iterator = typename std::list<T>::iterator;
iterator begin() { return List.begin(); }
iterator end() { return List.end(); }
@@ -87,7 +87,7 @@ template<typename Key, typename T> struct InsertOrderedMap {
Map;
std::list<std::pair<const Key, T>> List;
- typedef typename std::list<std::pair<const Key, T>>::iterator iterator;
+ using iterator = typename std::list<std::pair<const Key, T>>::iterator;
iterator begin() { return List.begin(); }
iterator end() { return List.end(); }
diff --git a/src/support/json.h b/src/support/json.h
index 269b6c0e9..bc880f382 100644
--- a/src/support/json.h
+++ b/src/support/json.h
@@ -65,8 +65,8 @@ struct Value {
Type type = Null;
- typedef std::vector<Ref> ArrayStorage;
- typedef std::unordered_map<IString, Ref> ObjectStorage;
+ using ArrayStorage = std::vector<Ref>;
+ using ObjectStorage = std::unordered_map<IString, Ref>;
// MSVC does not allow unrestricted unions:
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf
@@ -403,7 +403,7 @@ struct Value {
}
};
-typedef Value::Ref Ref;
+using Ref = Value::Ref;
} // namespace json
diff --git a/src/support/small_vector.h b/src/support/small_vector.h
index 7c03ae02b..c798dc594 100644
--- a/src/support/small_vector.h
+++ b/src/support/small_vector.h
@@ -148,9 +148,9 @@ public:
// iteration
template<typename Parent, typename Iterator> struct IteratorBase {
- typedef T value_type;
- typedef long difference_type;
- typedef T& reference;
+ using value_type = T;
+ using difference_type = long;
+ using reference = T&;
Parent* parent;
size_t index;