diff --git a/src/beast/beast/HeapBlock.h b/src/beast/beast/HeapBlock.h index 045fba5630..116f1f67d9 100644 --- a/src/beast/beast/HeapBlock.h +++ b/src/beast/beast/HeapBlock.h @@ -325,8 +325,8 @@ public: zeromem (data, sizeof (ElementType) * numElements); } - /** This typedef can be used to get the type of the heapblock's elements. */ - typedef ElementType Type; + /** This type alias can be used to get the type of the heapblock's elements. */ + using Type = ElementType; private: //============================================================================== diff --git a/src/beast/beast/asio/bind_handler.h b/src/beast/beast/asio/bind_handler.h index 968fb86207..b536db6e6a 100644 --- a/src/beast/beast/asio/bind_handler.h +++ b/src/beast/beast/asio/bind_handler.h @@ -41,7 +41,7 @@ template class bound_handler { private: - typedef std::tuple ...> args_type; + using args_type = std::tuple ...>; std::decay_t m_handler; args_type m_args; @@ -54,7 +54,7 @@ private: } public: - typedef void result_type; + using result_type = void; explicit bound_handler (DeducedHandler&& handler, Args&&... args) diff --git a/src/beast/beast/asio/io_latency_probe.h b/src/beast/beast/asio/io_latency_probe.h index 419b60ebde..158ed9ea37 100644 --- a/src/beast/beast/asio/io_latency_probe.h +++ b/src/beast/beast/asio/io_latency_probe.h @@ -36,8 +36,8 @@ template class io_latency_probe { private: - typedef typename Clock::duration duration; - typedef typename Clock::time_point time_point; + using duration = typename Clock::duration; + using time_point = typename Clock::time_point; std::recursive_mutex m_mutex; std::condition_variable_any m_cond; diff --git a/src/beast/beast/boost/ErrorCode.h b/src/beast/beast/boost/ErrorCode.h index ea2fb8436b..f87a157573 100644 --- a/src/beast/beast/boost/ErrorCode.h +++ b/src/beast/beast/boost/ErrorCode.h @@ -28,7 +28,7 @@ namespace beast { // use boost, and then switch to std::error_code when // it is available on all our supported platforms. // -typedef boost::system::error_code ErrorCode; +using ErrorCode = boost::system::error_code; } diff --git a/src/beast/beast/chrono/RelativeTime.h b/src/beast/beast/chrono/RelativeTime.h index f54346db25..0e42e4144d 100644 --- a/src/beast/beast/chrono/RelativeTime.h +++ b/src/beast/beast/chrono/RelativeTime.h @@ -51,7 +51,7 @@ public: you can use this to declare a type that is guaranteed to work cleanly. */ - typedef double value_type; + using value_type = double; //============================================================================== /** Creates a RelativeTime. diff --git a/src/beast/beast/container/buffer_view.h b/src/beast/beast/container/buffer_view.h index f6cc9f63bd..c153ca9305 100644 --- a/src/beast/beast/container/buffer_view.h +++ b/src/beast/beast/container/buffer_view.h @@ -39,13 +39,13 @@ template >::value> struct apply_const { - typedef U type; + using type = U; }; template struct apply_const { - typedef const U type; + using type = const U; }; // is_contiguous is true if C is a contiguous container @@ -161,7 +161,7 @@ private: void assign (Iter first, Iter last) noexcept { - typedef typename std::iterator_traits ::value_type U; + using U = typename std::iterator_traits ::value_type; static_assert (detail::buffer_view_const_compatible ::value, "Cannot convert from 'U const' to 'T', " @@ -190,17 +190,17 @@ private: } public: - typedef T value_type; - typedef std::size_t size_type; - typedef std::ptrdiff_t difference_type; - typedef T& reference; - typedef T const& const_reference; - typedef T* pointer; - typedef T const* const_pointer; - typedef T* iterator; - typedef T const* const_iterator; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; + using value_type = T; + using size_type = std::size_t; + using difference_type = std::ptrdiff_t; + using reference = T&; + using const_reference = T const&; + using pointer = T*; + using const_pointer = T const*; + using iterator = T*; + using const_iterator = T const*; + using reverse_iterator = std::reverse_iterator ; + using const_reverse_iterator = std::reverse_iterator ; // default construct buffer_view () noexcept diff --git a/src/beast/beast/container/const_container.h b/src/beast/beast/container/const_container.h index 43d02c4909..accd168fcb 100644 --- a/src/beast/beast/container/const_container.h +++ b/src/beast/beast/container/const_container.h @@ -30,7 +30,7 @@ template class const_container { private: - typedef Container cont_type; + using cont_type = Container; cont_type m_cont; @@ -46,11 +46,11 @@ protected: } public: - typedef typename cont_type::value_type value_type; - typedef typename cont_type::size_type size_type; - typedef typename cont_type::difference_type difference_type; - typedef typename cont_type::const_iterator iterator; - typedef typename cont_type::const_iterator const_iterator; + using value_type = typename cont_type::value_type; + using size_type = typename cont_type::size_type; + using difference_type = typename cont_type::difference_type; + using iterator = typename cont_type::const_iterator; + using const_iterator = typename cont_type::const_iterator; /** Returns `true` if the container is empty. */ bool diff --git a/src/beast/beast/container/cyclic_iterator.h b/src/beast/beast/container/cyclic_iterator.h index 71c20ff956..2afe817a00 100644 --- a/src/beast/beast/container/cyclic_iterator.h +++ b/src/beast/beast/container/cyclic_iterator.h @@ -61,7 +61,7 @@ struct cyclic_iterator_category< std::forward_iterator_tag > { - typedef std::forward_iterator_tag type; + using type = std::forward_iterator_tag; }; template<> @@ -69,7 +69,7 @@ struct cyclic_iterator_category< std::bidirectional_iterator_tag > { - typedef std::bidirectional_iterator_tag type; + using type = std::bidirectional_iterator_tag; }; template<> @@ -77,7 +77,7 @@ struct cyclic_iterator_category< std::random_access_iterator_tag > { - typedef std::bidirectional_iterator_tag type; + using type = std::bidirectional_iterator_tag; }; } @@ -94,7 +94,7 @@ template< > struct cyclic_iterator_base { - typedef boost::iterator_facade< + using type = boost::iterator_facade< cyclic_iterator< ContainerIterator >, @@ -109,7 +109,7 @@ struct cyclic_iterator_base typename std::iterator_traits< ContainerIterator >::reference - > type; + >; }; } @@ -153,39 +153,39 @@ public: /** \brief The base type which is a boost::iterator_facade */ - typedef typename detail::cyclic_iterator_base< + using base_type = typename detail::cyclic_iterator_base< ContainerIterator - >::type base_type; + >::type; /** \brief The underlying iterator type */ - typedef ContainerIterator container_iterator_type; + using container_iterator_type = ContainerIterator; /** \brief The value type adapted from \a ContainerIterator */ - typedef typename base_type::value_type value_type; + using value_type = typename base_type::value_type; /** \brief The reference type adapted from \a ContainerIterator */ - typedef typename base_type::reference reference; + using reference = typename base_type::reference; /** \brief The pointer type adapted from \a ContainerIterator */ - typedef typename base_type::pointer pointer; + using pointer = typename base_type::pointer; /** \brief The difference type adapted from \a ContainerIterator */ - typedef typename base_type::difference_type difference_type; + using difference_type = typename base_type::difference_type; /** \brief The iterator category, either Forward or Bidirectional */ - typedef typename base_type::iterator_category iterator_category; + using iterator_category = typename base_type::iterator_category; /** \brief Creates a singular iterator diff --git a/src/beast/beast/container/detail/aged_unordered_container.h b/src/beast/beast/container/detail/aged_unordered_container.h index 0b7d178adf..cffa6ea779 100644 --- a/src/beast/beast/container/detail/aged_unordered_container.h +++ b/src/beast/beast/container/detail/aged_unordered_container.h @@ -249,7 +249,7 @@ private: }; using list_type = typename boost::intrusive::make_list >::type ; + boost::intrusive::constant_time_size >::type; using cont_type = typename std::conditional < IsMulti, diff --git a/src/beast/beast/container/tests/aged_associative_container.test.cpp b/src/beast/beast/container/tests/aged_associative_container.test.cpp index 6a77d5d2d2..1b66f3b356 100644 --- a/src/beast/beast/container/tests/aged_associative_container.test.cpp +++ b/src/beast/beast/container/tests/aged_associative_container.test.cpp @@ -113,14 +113,14 @@ public: template struct AllocT { - typedef T value_type; + using value_type = T; - //typedef propagate_on_container_swap : std::true_type::type; + //using std::true_type::type = propagate_on_container_swap :; template struct rebind { - typedef AllocT other; + using other = AllocT ; }; explicit AllocT (int) @@ -170,8 +170,8 @@ public: class MaybeUnordered : public Base { public: - typedef std::less Comp; - typedef CompT MyComp; + using Comp = std::less ; + using MyComp = CompT ; protected: static std::string name_ordered_part() @@ -185,10 +185,10 @@ public: class MaybeUnordered : public Base { public: - typedef std::hash Hash; - typedef std::equal_to Equal; - typedef HashT MyHash; - typedef EqualT MyEqual; + using Hash = std::hash ; + using Equal = std::equal_to ; + using MyHash = HashT ; + using MyEqual = EqualT ; protected: static std::string name_ordered_part() @@ -226,9 +226,9 @@ public: class MaybeMap : public Base { public: - typedef void T; - typedef typename Base::Key Value; - typedef std::vector Values; + using T = void; + using Value = typename Base::Key; + using Values = std::vector ; static typename Base::Key const& extract (Value const& value) { @@ -259,9 +259,9 @@ public: class MaybeMap : public Base { public: - typedef int T; - typedef std::pair Value; - typedef std::vector Values; + using T = int; + using Value = std::pair ; + using Values = std::vector ; static typename Base::Key const& extract (Value const& value) { @@ -326,9 +326,9 @@ public: struct TestTraitsBase { - typedef std::string Key; - typedef std::chrono::steady_clock Clock; - typedef manual_clock ManualClock; + using Key = std::string; + using Clock = std::chrono::steady_clock; + using ManualClock = manual_clock; }; template @@ -337,18 +337,18 @@ public: TestTraitsBase, IsMap>, IsMulti>, IsUnordered> { private: - typedef MaybeUnordered , IsMulti>, IsUnordered> Base; + using Base = MaybeUnordered , IsMulti>, IsUnordered>; public: using typename Base::Key; - typedef std::integral_constant is_unordered; - typedef std::integral_constant is_multi; - typedef std::integral_constant is_map; + using is_unordered = std::integral_constant ; + using is_multi = std::integral_constant ; + using is_map = std::integral_constant ; - typedef std::allocator Alloc; - typedef AllocT MyAlloc; + using Alloc = std::allocator ; + using MyAlloc = AllocT ; static std::string name() { @@ -645,13 +645,13 @@ typename std::enable_if < aged_associative_container_test_base:: checkUnorderedContentsRefRef (C&& c, Values const& v) { - typedef typename std::remove_reference ::type Cont; - typedef TestTraits < + using Cont = typename std::remove_reference ::type; + using Traits = TestTraits < Cont::is_unordered::value, Cont::is_multi::value, Cont::is_map::value - > Traits; - typedef typename Cont::size_type size_type; + >; + using size_type = typename Cont::size_type; auto const hash (c.hash_function()); auto const key_eq (c.key_eq()); for (size_type i (0); i < c.bucket_count(); ++i) @@ -679,13 +679,13 @@ void aged_associative_container_test_base:: checkContentsRefRef (C&& c, Values const& v) { - typedef typename std::remove_reference ::type Cont; - typedef TestTraits < + using Cont = typename std::remove_reference ::type; + using Traits = TestTraits < Cont::is_unordered::value, Cont::is_multi::value, Cont::is_map::value - > Traits; - typedef typename Cont::size_type size_type; + >; + using size_type = typename Cont::size_type; expect (c.size() == v.size()); expect (size_type (std::distance ( @@ -719,12 +719,12 @@ void aged_associative_container_test_base:: checkContents (Cont& c) { - typedef TestTraits < + using Traits = TestTraits < Cont::is_unordered::value, Cont::is_multi::value, Cont::is_map::value - > Traits; - typedef typename Traits::Values Values; + >; + using Values = typename Traits::Values; checkContents (c, Values()); } @@ -740,15 +740,15 @@ typename std::enable_if ::type aged_associative_container_test_base:: testConstructEmpty () { - typedef TestTraits Traits; - typedef typename Traits::Value Value; - typedef typename Traits::Key Key; - typedef typename Traits::T T; - typedef typename Traits::Clock Clock; - typedef typename Traits::Comp Comp; - typedef typename Traits::Alloc Alloc; - typedef typename Traits::MyComp MyComp; - typedef typename Traits::MyAlloc MyAlloc; + using Traits = TestTraits ; + using Value = typename Traits::Value; + using Key = typename Traits::Key; + using T = typename Traits::T; + using Clock = typename Traits::Clock; + using Comp = typename Traits::Comp; + using Alloc = typename Traits::Alloc; + using MyComp = typename Traits::MyComp; + using MyAlloc = typename Traits::MyAlloc; typename Traits::ManualClock clock; //testcase (Traits::name() + " empty"); @@ -785,17 +785,17 @@ typename std::enable_if ::type aged_associative_container_test_base:: testConstructEmpty () { - typedef TestTraits Traits; - typedef typename Traits::Value Value; - typedef typename Traits::Key Key; - typedef typename Traits::T T; - typedef typename Traits::Clock Clock; - typedef typename Traits::Hash Hash; - typedef typename Traits::Equal Equal; - typedef typename Traits::Alloc Alloc; - typedef typename Traits::MyHash MyHash; - typedef typename Traits::MyEqual MyEqual; - typedef typename Traits::MyAlloc MyAlloc; + using Traits = TestTraits ; + using Value = typename Traits::Value; + using Key = typename Traits::Key; + using T = typename Traits::T; + using Clock = typename Traits::Clock; + using Hash = typename Traits::Hash; + using Equal = typename Traits::Equal; + using Alloc = typename Traits::Alloc; + using MyHash = typename Traits::MyHash; + using MyEqual = typename Traits::MyEqual; + using MyAlloc = typename Traits::MyAlloc; typename Traits::ManualClock clock; //testcase (Traits::name() + " empty"); @@ -855,15 +855,15 @@ typename std::enable_if ::type aged_associative_container_test_base:: testConstructRange () { - typedef TestTraits Traits; - typedef typename Traits::Value Value; - typedef typename Traits::Key Key; - typedef typename Traits::T T; - typedef typename Traits::Clock Clock; - typedef typename Traits::Comp Comp; - typedef typename Traits::Alloc Alloc; - typedef typename Traits::MyComp MyComp; - typedef typename Traits::MyAlloc MyAlloc; + using Traits = TestTraits ; + using Value = typename Traits::Value; + using Key = typename Traits::Key; + using T = typename Traits::T; + using Clock = typename Traits::Clock; + using Comp = typename Traits::Comp; + using Alloc = typename Traits::Alloc; + using MyComp = typename Traits::MyComp; + using MyAlloc = typename Traits::MyAlloc; typename Traits::ManualClock clock; auto const v (Traits::values()); @@ -918,17 +918,17 @@ typename std::enable_if ::type aged_associative_container_test_base:: testConstructRange () { - typedef TestTraits Traits; - typedef typename Traits::Value Value; - typedef typename Traits::Key Key; - typedef typename Traits::T T; - typedef typename Traits::Clock Clock; - typedef typename Traits::Hash Hash; - typedef typename Traits::Equal Equal; - typedef typename Traits::Alloc Alloc; - typedef typename Traits::MyHash MyHash; - typedef typename Traits::MyEqual MyEqual; - typedef typename Traits::MyAlloc MyAlloc; + using Traits = TestTraits ; + using Value = typename Traits::Value; + using Key = typename Traits::Key; + using T = typename Traits::T; + using Clock = typename Traits::Clock; + using Hash = typename Traits::Hash; + using Equal = typename Traits::Equal; + using Alloc = typename Traits::Alloc; + using MyHash = typename Traits::MyHash; + using MyEqual = typename Traits::MyEqual; + using MyAlloc = typename Traits::MyAlloc; typename Traits::ManualClock clock; auto const v (Traits::values()); @@ -998,15 +998,15 @@ typename std::enable_if ::type aged_associative_container_test_base:: testConstructInitList () { - typedef TestTraits Traits; - typedef typename Traits::Value Value; - typedef typename Traits::Key Key; - typedef typename Traits::T T; - typedef typename Traits::Clock Clock; - typedef typename Traits::Comp Comp; - typedef typename Traits::Alloc Alloc; - typedef typename Traits::MyComp MyComp; - typedef typename Traits::MyAlloc MyAlloc; + using Traits = TestTraits ; + using Value = typename Traits::Value; + using Key = typename Traits::Key; + using T = typename Traits::T; + using Clock = typename Traits::Clock; + using Comp = typename Traits::Comp; + using Alloc = typename Traits::Alloc; + using MyComp = typename Traits::MyComp; + using MyAlloc = typename Traits::MyAlloc; typename Traits::ManualClock clock; //testcase (Traits::name() + " init-list"); @@ -1023,17 +1023,17 @@ typename std::enable_if ::type aged_associative_container_test_base:: testConstructInitList () { - typedef TestTraits Traits; - typedef typename Traits::Value Value; - typedef typename Traits::Key Key; - typedef typename Traits::T T; - typedef typename Traits::Clock Clock; - typedef typename Traits::Hash Hash; - typedef typename Traits::Equal Equal; - typedef typename Traits::Alloc Alloc; - typedef typename Traits::MyHash MyHash; - typedef typename Traits::MyEqual MyEqual; - typedef typename Traits::MyAlloc MyAlloc; + using Traits = TestTraits ; + using Value = typename Traits::Value; + using Key = typename Traits::Key; + using T = typename Traits::T; + using Clock = typename Traits::Clock; + using Hash = typename Traits::Hash; + using Equal = typename Traits::Equal; + using Alloc = typename Traits::Alloc; + using MyHash = typename Traits::MyHash; + using MyEqual = typename Traits::MyEqual; + using MyAlloc = typename Traits::MyAlloc; typename Traits::ManualClock clock; //testcase (Traits::name() + " init-list"); @@ -1054,9 +1054,9 @@ void aged_associative_container_test_base:: testCopyMove () { - typedef TestTraits Traits; - typedef typename Traits::Value Value; - typedef typename Traits::Alloc Alloc; + using Traits = TestTraits ; + using Value = typename Traits::Value; + using Alloc = typename Traits::Alloc; typename Traits::ManualClock clock; auto const v (Traits::values()); @@ -1136,9 +1136,9 @@ void aged_associative_container_test_base:: testIterator() { - typedef TestTraits Traits; - typedef typename Traits::Value Value; - typedef typename Traits::Alloc Alloc; + using Traits = TestTraits ; + using Value = typename Traits::Value; + using Alloc = typename Traits::Alloc; typename Traits::ManualClock clock; auto const v (Traits::values()); @@ -1199,9 +1199,9 @@ typename std::enable_if ::type aged_associative_container_test_base:: testReverseIterator() { - typedef TestTraits Traits; - typedef typename Traits::Value Value; - typedef typename Traits::Alloc Alloc; + using Traits = TestTraits ; + using Value = typename Traits::Value; + using Alloc = typename Traits::Alloc; typename Traits::ManualClock clock; auto const v (Traits::values()); @@ -1356,7 +1356,7 @@ void aged_associative_container_test_base:: testModifiers() { - typedef TestTraits Traits; + using Traits = TestTraits ; typename Traits::ManualClock clock; auto const v (Traits::values()); auto const l (make_list (v)); @@ -1416,8 +1416,8 @@ void aged_associative_container_test_base:: testChronological () { - typedef TestTraits Traits; - typedef typename Traits::Value Value; + using Traits = TestTraits ; + using Value = typename Traits::Value; typename Traits::ManualClock clock; auto const v (Traits::values()); @@ -1483,7 +1483,7 @@ typename std::enable_if ::type aged_associative_container_test_base:: testArrayCreate() { - typedef TestTraits Traits; + using Traits = TestTraits ; typename Traits::ManualClock clock; auto v (Traits::values()); @@ -1523,7 +1523,7 @@ reverseFillAgedContainer (Container& c, Values const& values) // c.clock() returns an abstract_clock, so dynamic_cast to manual_clock. // VFALCO NOTE This is sketchy - typedef TestTraitsBase::ManualClock ManualClock; + using ManualClock = TestTraitsBase::ManualClock; ManualClock& clk (dynamic_cast (c.clock())); clk.set (0); @@ -1621,7 +1621,7 @@ void aged_associative_container_test_base:: testElementErase () { - typedef TestTraits Traits; + using Traits = TestTraits ; //testcase (Traits::name() + " element erase" testcase ("element erase"); @@ -1751,7 +1751,7 @@ void aged_associative_container_test_base:: testRangeErase () { - typedef TestTraits Traits; + using Traits = TestTraits ; //testcase (Traits::name() + " element erase" testcase ("range erase"); @@ -1784,8 +1784,8 @@ typename std::enable_if ::type aged_associative_container_test_base:: testCompare () { - typedef TestTraits Traits; - typedef typename Traits::Value Value; + using Traits = TestTraits ; + using Value = typename Traits::Value; typename Traits::ManualClock clock; auto const v (Traits::values()); @@ -1819,7 +1819,7 @@ typename std::enable_if ::type aged_associative_container_test_base:: testObservers() { - typedef TestTraits Traits; + using Traits = TestTraits ; typename Traits::ManualClock clock; //testcase (Traits::name() + " observers"); @@ -1838,7 +1838,7 @@ typename std::enable_if ::type aged_associative_container_test_base:: testObservers() { - typedef TestTraits Traits; + using Traits = TestTraits ; typename Traits::ManualClock clock; //testcase (Traits::name() + " observers"); @@ -1862,7 +1862,7 @@ void aged_associative_container_test_base:: testMaybeUnorderedMultiMap () { - typedef TestTraits Traits; + using Traits = TestTraits ; testConstructEmpty (); testConstructRange (); @@ -1886,8 +1886,8 @@ class aged_set_test : public aged_associative_container_test_base public: // Compile time checks - typedef std::string Key; - typedef int T; + using Key = std::string; + using T = int; static_assert (std::is_same < aged_set , diff --git a/src/beast/beast/crypto/Sha256.h b/src/beast/beast/crypto/Sha256.h index a772ccb04e..42935c8eda 100644 --- a/src/beast/beast/crypto/Sha256.h +++ b/src/beast/beast/crypto/Sha256.h @@ -37,7 +37,7 @@ enum }; /** A container suitable for holding the resulting hash. */ -typedef std::array digest_type; +using digest_type = std::array ; namespace detail { struct Context diff --git a/src/beast/beast/cxx14/functional.h b/src/beast/beast/cxx14/functional.h index f1e217f043..faf6cb9f38 100644 --- a/src/beast/beast/cxx14/functional.h +++ b/src/beast/beast/cxx14/functional.h @@ -36,7 +36,7 @@ template <> struct equal_to { // VFALCO NOTE Its not clear how to support is_transparent pre c++14 - typedef std::true_type is_transparent; + using is_transparent = std::true_type; template auto operator() (T&& lhs, U&& rhs) const -> diff --git a/src/beast/beast/cxx14/utility.h b/src/beast/beast/cxx14/utility.h index fa882c2aa4..119be94771 100644 --- a/src/beast/beast/cxx14/utility.h +++ b/src/beast/beast/cxx14/utility.h @@ -31,7 +31,7 @@ namespace std { template struct integer_sequence { - typedef T value_type; + using value_type = T; static_assert (is_integral::value, "std::integer_sequence can only be instantiated with an integral type" ); @@ -70,15 +70,15 @@ template struct make_integer_sequence_unchecked < T, N, integer_sequence > { - typedef typename make_integer_sequence_unchecked< - T, N-1, integer_sequence>::type type; + using type = typename make_integer_sequence_unchecked< + T, N-1, integer_sequence>::type; }; template struct make_integer_sequence_unchecked < T, 0, integer_sequence> { - typedef integer_sequence type; + using type = integer_sequence ; }; template @@ -90,8 +90,8 @@ struct make_integer_sequence_checked static_assert (N >= 0, "N must be non-negative"); - typedef typename make_integer_sequence_unchecked < - T, N, integer_sequence>::type type; + using type = typename make_integer_sequence_unchecked < + T, N, integer_sequence>::type; }; } // detail @@ -116,20 +116,20 @@ namespace detail { template struct index_tuple { - typedef index_tuple next; + using next = index_tuple ; }; template struct build_index_tuple { - typedef typename build_index_tuple ::type::next type; + using type = typename build_index_tuple ::type::next; }; template <> struct build_index_tuple <0> { - typedef index_tuple<> type; + using type = index_tuple<>; }; template > static_assert (N >= 0, "N must be non-negative"); - typedef integer_sequence (Ints)...> type; + using type = integer_sequence (Ints)...>; }; } // detail diff --git a/src/beast/beast/hash/impl/siphash.cpp b/src/beast/beast/hash/impl/siphash.cpp index 00782b86fd..9702f5afee 100644 --- a/src/beast/beast/hash/impl/siphash.cpp +++ b/src/beast/beast/hash/impl/siphash.cpp @@ -34,9 +34,9 @@ namespace beast { namespace detail { -typedef std::uint64_t u64; -typedef std::uint32_t u32; -typedef std::uint8_t u8; +using u64 = std::uint64_t; +using u32 = std::uint32_t; +using u8 = std::uint8_t; inline u64 diff --git a/src/beast/beast/hash/tests/hash_append_test.cpp b/src/beast/beast/hash/tests/hash_append_test.cpp index 1dc6e64923..887278cc0e 100644 --- a/src/beast/beast/hash/tests/hash_append_test.cpp +++ b/src/beast/beast/hash/tests/hash_append_test.cpp @@ -235,7 +235,7 @@ private: std::size_t m_seed; PRNG m_prng; - typedef block_stream > base; + using base = block_stream >; friend base; // compress @@ -351,8 +351,8 @@ struct is_contiguously_hashable class hash_append_test : public unit_test::suite { public: - typedef hash_append_tests::SlowKey SlowKey; - typedef hash_append_tests::FastKey FastKey; + using SlowKey = hash_append_tests::SlowKey; + using FastKey = hash_append_tests::FastKey; struct results_t { diff --git a/src/beast/beast/hash/tests/hash_metrics.h b/src/beast/beast/hash/tests/hash_metrics.h index e0c5212186..3d42747c90 100644 --- a/src/beast/beast/hash/tests/hash_metrics.h +++ b/src/beast/beast/hash/tests/hash_metrics.h @@ -51,7 +51,7 @@ template float distribution_factor (FwdIter first, FwdIter last) { - typedef typename FwdIter::value_type value_type; + using value_type = typename FwdIter::value_type; static_assert (std::is_unsigned ::value, ""); const unsigned nbits = CHAR_BIT * sizeof(std::size_t); diff --git a/src/beast/beast/http/basic_parser.h b/src/beast/beast/http/basic_parser.h index 769bfbf9d6..a0397f49c3 100644 --- a/src/beast/beast/http/basic_parser.h +++ b/src/beast/beast/http/basic_parser.h @@ -61,9 +61,9 @@ private: void *data; }; - typedef int (*data_cb_t) ( + using data_cb_t = int (*) ( state_t*, const char *at, size_t length); - typedef int (*cb_t) (state_t*); + using cb_t = int (*) (state_t*); struct hooks_t { @@ -87,7 +87,7 @@ private: std::string value_; public: - typedef boost::system::error_code error_code; + using error_code = boost::system::error_code; virtual ~basic_parser() = default; diff --git a/src/beast/beast/http/body.h b/src/beast/beast/http/body.h index 69ac0b85a5..82679256e7 100644 --- a/src/beast/beast/http/body.h +++ b/src/beast/beast/http/body.h @@ -35,13 +35,13 @@ namespace http { class body { private: - typedef boost::asio::streambuf buffer_type; + using buffer_type = boost::asio::streambuf; // Hack: use unique_ptr because streambuf cant be moved std::unique_ptr buf_; public: - typedef buffer_type::const_buffers_type const_buffers_type; + using const_buffers_type = buffer_type::const_buffers_type; body(); body (body&& other); diff --git a/src/beast/beast/http/detail/header_traits.h b/src/beast/beast/http/detail/header_traits.h index 274ca2601a..28a98bd6eb 100644 --- a/src/beast/beast/http/detail/header_traits.h +++ b/src/beast/beast/http/detail/header_traits.h @@ -37,9 +37,9 @@ template > using basic_field_string = std::basic_string ; -typedef basic_field_string <> field_string; +using field_string = basic_field_string <>; -typedef boost::basic_string_ref field_string_ref; +using field_string_ref = boost::basic_string_ref ; /** Returns `true` if two header fields are the same. The comparison is case-insensitive. diff --git a/src/beast/beast/http/headers.h b/src/beast/beast/http/headers.h index ba06fcfbe6..940047312b 100644 --- a/src/beast/beast/http/headers.h +++ b/src/beast/beast/http/headers.h @@ -76,21 +76,21 @@ private: } }; - typedef boost::intrusive::make_list - >::type list_t; + >::type; - typedef boost::intrusive::make_set - >::type set_t; + >::type; list_t list_; set_t set_; public: - typedef boost::transform_iterator iterator; - typedef iterator const_iterator; + using iterator = boost::transform_iterator ; + using const_iterator = iterator; ~headers() { diff --git a/src/beast/beast/http/impl/http-parser/README.md b/src/beast/beast/http/impl/http-parser/README.md index 0bf5d359ac..f280ff3403 100644 --- a/src/beast/beast/http/impl/http-parser/README.md +++ b/src/beast/beast/http/impl/http-parser/README.md @@ -128,9 +128,9 @@ save certain data for later usage, you can do that from the callbacks. There are two types of callbacks: -* notification `typedef int (*http_cb) (http_parser*);` +* notification `using http_cb = int (*) (http_parser*);` Callbacks: on_message_begin, on_headers_complete, on_message_complete. -* data `typedef int (*http_data_cb) (http_parser*, const char *at, size_t length);` +* data `using http_data_cb = int (*) (http_parser*, const char *at, size_t length);` Callbacks: (requests only) on_uri, (common) on_header_field, on_header_value, on_body; diff --git a/src/beast/beast/http/impl/joyent_parser.cpp b/src/beast/beast/http/impl/joyent_parser.cpp index 50c8f715dd..da444b1a3d 100644 --- a/src/beast/beast/http/impl/joyent_parser.cpp +++ b/src/beast/beast/http/impl/joyent_parser.cpp @@ -111,8 +111,8 @@ convert_http_errno (joyent::http_errno err) : public boost::system::error_category { private: - typedef boost::system::error_code error_code; - typedef boost::system::error_condition error_condition; + using error_code = boost::system::error_code; + using error_condition = boost::system::error_condition; public: char const* diff --git a/src/beast/beast/http/raw_parser.h b/src/beast/beast/http/raw_parser.h index cc87d07af1..47e4b20697 100644 --- a/src/beast/beast/http/raw_parser.h +++ b/src/beast/beast/http/raw_parser.h @@ -43,7 +43,7 @@ namespace http { class raw_parser { private: - typedef boost::system::error_code error_code; + using error_code = boost::system::error_code; public: enum message_type @@ -174,9 +174,9 @@ private: void *data; }; - typedef int (*data_cb_t) ( + using data_cb_t = int (*) ( state_t*, const char *at, size_t length); - typedef int (*cb_t) (state_t*); + using cb_t = int (*) (state_t*); struct hooks_t { diff --git a/src/beast/beast/insight/BaseImpl.h b/src/beast/beast/insight/BaseImpl.h index 6c3d7821d3..4deb3a46be 100644 --- a/src/beast/beast/insight/BaseImpl.h +++ b/src/beast/beast/insight/BaseImpl.h @@ -32,7 +32,7 @@ namespace insight { class BaseImpl { public: - typedef std::shared_ptr ptr; + using ptr = std::shared_ptr ; virtual ~BaseImpl () = 0; }; diff --git a/src/beast/beast/insight/Collector.h b/src/beast/beast/insight/Collector.h index 3b72174da3..e177c3f6ee 100644 --- a/src/beast/beast/insight/Collector.h +++ b/src/beast/beast/insight/Collector.h @@ -44,7 +44,7 @@ namespace insight { class Collector { public: - typedef std::shared_ptr ptr; + using ptr = std::shared_ptr ; virtual ~Collector() = 0; diff --git a/src/beast/beast/insight/Counter.h b/src/beast/beast/insight/Counter.h index 8086bc58b0..6ec79ec3e7 100644 --- a/src/beast/beast/insight/Counter.h +++ b/src/beast/beast/insight/Counter.h @@ -39,7 +39,7 @@ namespace insight { class Counter : public Base { public: - typedef CounterImpl::value_type value_type; + using value_type = CounterImpl::value_type; /** Create a null metric. A null metric reports no information. diff --git a/src/beast/beast/insight/CounterImpl.h b/src/beast/beast/insight/CounterImpl.h index 3bc11f9617..06f57e8059 100644 --- a/src/beast/beast/insight/CounterImpl.h +++ b/src/beast/beast/insight/CounterImpl.h @@ -32,7 +32,7 @@ class CounterImpl , public BaseImpl { public: - typedef std::int64_t value_type; + using value_type = std::int64_t; virtual ~CounterImpl () = 0; virtual void increment (value_type amount) = 0; diff --git a/src/beast/beast/insight/Event.h b/src/beast/beast/insight/Event.h index c3a166f0f3..ae504900fb 100644 --- a/src/beast/beast/insight/Event.h +++ b/src/beast/beast/insight/Event.h @@ -43,7 +43,7 @@ namespace insight { class Event : public Base { public: - typedef EventImpl::value_type value_type; + using value_type = EventImpl::value_type; /** Create a null metric. A null metric reports no information. diff --git a/src/beast/beast/insight/EventImpl.h b/src/beast/beast/insight/EventImpl.h index 7611b29873..07f6d73890 100644 --- a/src/beast/beast/insight/EventImpl.h +++ b/src/beast/beast/insight/EventImpl.h @@ -32,7 +32,7 @@ class EventImpl , public BaseImpl { public: - typedef std::chrono::milliseconds value_type; + using value_type = std::chrono::milliseconds; virtual ~EventImpl () = 0; virtual void notify (value_type const& value) = 0; diff --git a/src/beast/beast/insight/Gauge.h b/src/beast/beast/insight/Gauge.h index 3c296f09a3..6e6c580dbe 100644 --- a/src/beast/beast/insight/Gauge.h +++ b/src/beast/beast/insight/Gauge.h @@ -40,8 +40,8 @@ namespace insight { class Gauge : public Base { public: - typedef GaugeImpl::value_type value_type; - typedef GaugeImpl::difference_type difference_type; + using value_type = GaugeImpl::value_type; + using difference_type = GaugeImpl::difference_type; /** Create a null metric. A null metric reports no information. diff --git a/src/beast/beast/insight/GaugeImpl.h b/src/beast/beast/insight/GaugeImpl.h index 9d19a567d5..06703973f8 100644 --- a/src/beast/beast/insight/GaugeImpl.h +++ b/src/beast/beast/insight/GaugeImpl.h @@ -32,8 +32,8 @@ class GaugeImpl , public BaseImpl { public: - typedef std::uint64_t value_type; - typedef std::int64_t difference_type; + using value_type = std::uint64_t; + using difference_type = std::int64_t; virtual ~GaugeImpl () = 0; virtual void set (value_type value) = 0; diff --git a/src/beast/beast/insight/Group.h b/src/beast/beast/insight/Group.h index 858f8c3b4a..e895403a96 100644 --- a/src/beast/beast/insight/Group.h +++ b/src/beast/beast/insight/Group.h @@ -32,7 +32,7 @@ namespace insight { class Group : public Collector { public: - typedef std::shared_ptr ptr; + using ptr = std::shared_ptr ; /** Returns the name of this group, for diagnostics. */ virtual std::string const& name () const = 0; diff --git a/src/beast/beast/insight/HookImpl.h b/src/beast/beast/insight/HookImpl.h index 4b9ab72042..35ee91bc88 100644 --- a/src/beast/beast/insight/HookImpl.h +++ b/src/beast/beast/insight/HookImpl.h @@ -30,7 +30,7 @@ class HookImpl , public BaseImpl { public: - typedef std::function HandlerType; + using HandlerType = std::function ; virtual ~HookImpl () = 0; }; diff --git a/src/beast/beast/insight/Meter.h b/src/beast/beast/insight/Meter.h index b8cde62a6d..709b28d5b3 100644 --- a/src/beast/beast/insight/Meter.h +++ b/src/beast/beast/insight/Meter.h @@ -38,7 +38,7 @@ namespace insight { class Meter : public Base { public: - typedef MeterImpl::value_type value_type; + using value_type = MeterImpl::value_type; /** Create a null metric. A null metric reports no information. diff --git a/src/beast/beast/insight/MeterImpl.h b/src/beast/beast/insight/MeterImpl.h index de354722a2..defa546e08 100644 --- a/src/beast/beast/insight/MeterImpl.h +++ b/src/beast/beast/insight/MeterImpl.h @@ -32,7 +32,7 @@ class MeterImpl , public BaseImpl { public: - typedef std::uint64_t value_type; + using value_type = std::uint64_t; virtual ~MeterImpl () = 0; virtual void increment (value_type amount) = 0; diff --git a/src/beast/beast/insight/impl/Groups.cpp b/src/beast/beast/insight/impl/Groups.cpp index f8f3f3e6b9..f909ef1dac 100644 --- a/src/beast/beast/insight/impl/Groups.cpp +++ b/src/beast/beast/insight/impl/Groups.cpp @@ -31,7 +31,7 @@ class GroupImp , public Group { public: - typedef std::vector > Items; + using Items = std::vector >; std::string const m_name; Collector::ptr m_collector; @@ -91,7 +91,7 @@ private: class GroupsImp : public Groups { public: - typedef std::unordered_map , uhash <>> Items; + using Items = std::unordered_map , uhash <>>; Collector::ptr m_collector; Items m_items; diff --git a/src/beast/beast/insight/impl/StatsDCollector.cpp b/src/beast/beast/insight/impl/StatsDCollector.cpp index 7e7056c8e9..55f0f5b0cd 100644 --- a/src/beast/beast/insight/impl/StatsDCollector.cpp +++ b/src/beast/beast/insight/impl/StatsDCollector.cpp @@ -197,7 +197,7 @@ private: List metrics; }; - typedef SharedData State; + using State = SharedData ; Journal m_journal; IP::Endpoint m_address; diff --git a/src/beast/beast/intrusive/List.h b/src/beast/beast/intrusive/List.h index 6005eea2fb..d1abe618dd 100644 --- a/src/beast/beast/intrusive/List.h +++ b/src/beast/beast/intrusive/List.h @@ -37,13 +37,13 @@ namespace detail { template struct CopyConst { - typedef typename std::remove_const ::type type; + using type = typename std::remove_const ::type; }; template struct CopyConst { - typedef typename std::remove_const ::type const type; + using type = typename std::remove_const ::type const; }; /** @} */ @@ -55,7 +55,7 @@ template class ListNode { private: - typedef T value_type; + using value_type = T; friend class List; @@ -73,11 +73,11 @@ class ListIterator : public std::iterator < std::bidirectional_iterator_tag, std::size_t> { public: - typedef typename detail::CopyConst < - N, typename N::value_type>::type value_type; - typedef value_type* pointer; - typedef value_type& reference; - typedef std::size_t size_type; + using value_type = typename detail::CopyConst < + N, typename N::value_type>::type; + using pointer = value_type*; + using reference = value_type&; + using size_type = std::size_t; ListIterator (N* node = nullptr) noexcept : m_node (node) @@ -242,8 +242,8 @@ private: struct ProcessTag { }; struct UpdateTag { }; - typedef List ProcessList; - typedef List UpdateList; + using ProcessList = List ; + using UpdateList = List ; // Derive from both node types so we can be in each list at once. // @@ -267,18 +267,18 @@ template class List { public: - typedef typename detail::ListNode Node; + using Node = typename detail::ListNode ; - typedef T value_type; - typedef value_type* pointer; - typedef value_type& reference; - typedef value_type const* const_pointer; - typedef value_type const& const_reference; - typedef std::size_t size_type; - typedef std::ptrdiff_t difference_type; + using value_type = T; + using pointer = value_type*; + using reference = value_type&; + using const_pointer = value_type const*; + using const_reference = value_type const&; + using size_type = std::size_t; + using difference_type = std::ptrdiff_t; - typedef detail::ListIterator iterator; - typedef detail::ListIterator const_iterator; + using iterator = detail::ListIterator ; + using const_iterator = detail::ListIterator ; /** Create an empty list. */ List () diff --git a/src/beast/beast/intrusive/LockFreeStack.h b/src/beast/beast/intrusive/LockFreeStack.h index 92d9201fe2..1fb1b4febf 100644 --- a/src/beast/beast/intrusive/LockFreeStack.h +++ b/src/beast/beast/intrusive/LockFreeStack.h @@ -42,18 +42,18 @@ class LockFreeStackIterator typename Container::reference>::type> { protected: - typedef typename Container::Node Node; - typedef typename std::conditional < - IsConst, Node const*, Node*>::type NodePtr; + using Node = typename Container::Node; + using NodePtr = typename std::conditional < + IsConst, Node const*, Node*>::type; public: - typedef typename Container::value_type value_type; - typedef typename std::conditional ::type pointer; - typedef typename std::conditional ::type; + using reference = typename std::conditional ::type reference; + typename Container::reference>::type; LockFreeStackIterator () : m_node () @@ -167,17 +167,17 @@ public: }; public: - typedef Element value_type; - typedef Element* pointer; - typedef Element& reference; - typedef Element const* const_pointer; - typedef Element const& const_reference; - typedef std::size_t size_type; - typedef std::ptrdiff_t difference_type; - typedef LockFreeStackIterator < - LockFreeStack , false> iterator; - typedef LockFreeStackIterator < - LockFreeStack , true> const_iterator; + using value_type = Element; + using pointer = Element*; + using reference = Element&; + using const_pointer = Element const*; + using const_reference = Element const&; + using size_type = std::size_t; + using difference_type = std::ptrdiff_t; + using iterator = LockFreeStackIterator < + LockFreeStack , false>; + using const_iterator = LockFreeStackIterator < + LockFreeStack , true>; LockFreeStack () : m_end (nullptr) diff --git a/src/beast/beast/module/core/containers/Array.h b/src/beast/beast/module/core/containers/Array.h index 6ef234a7e8..c9d8295b27 100644 --- a/src/beast/beast/module/core/containers/Array.h +++ b/src/beast/beast/module/core/containers/Array.h @@ -57,7 +57,7 @@ template class DefaultElementComparator { private: - typedef ElementType ParameterType; + using ParameterType = ElementType; public: static int compareElements (ParameterType first, ParameterType second) diff --git a/src/beast/beast/module/core/diagnostic/SemanticVersion.cpp b/src/beast/beast/module/core/diagnostic/SemanticVersion.cpp index aba2dc7588..9a31b4f33e 100644 --- a/src/beast/beast/module/core/diagnostic/SemanticVersion.cpp +++ b/src/beast/beast/module/core/diagnostic/SemanticVersion.cpp @@ -322,7 +322,7 @@ int compare (SemanticVersion const& lhs, SemanticVersion const& rhs) class SemanticVersion_test: public unit_test::suite { - typedef SemanticVersion::identifier_list identifier_list; + using identifier_list = SemanticVersion::identifier_list; public: void checkPass (std::string const& input, bool shouldPass = true) diff --git a/src/beast/beast/module/core/diagnostic/SemanticVersion.h b/src/beast/beast/module/core/diagnostic/SemanticVersion.h index 0b7ef0862a..a2a3311a6c 100644 --- a/src/beast/beast/module/core/diagnostic/SemanticVersion.h +++ b/src/beast/beast/module/core/diagnostic/SemanticVersion.h @@ -37,7 +37,7 @@ namespace beast { class SemanticVersion { public: - typedef std::vector identifier_list; + using identifier_list = std::vector; int majorVersion; int minorVersion; diff --git a/src/beast/beast/module/core/memory/MemoryBlock.h b/src/beast/beast/module/core/memory/MemoryBlock.h index 8c080dd72a..76f5aa1bd6 100644 --- a/src/beast/beast/module/core/memory/MemoryBlock.h +++ b/src/beast/beast/module/core/memory/MemoryBlock.h @@ -74,8 +74,8 @@ public: #endif // Standard container interface - typedef char* iterator; - typedef char const* const_iterator; + using iterator = char*; + using const_iterator = char const*; inline iterator begin () noexcept { return static_cast (getData ()); } inline iterator end () noexcept { return addBytesToPointer (begin (), size); } inline const_iterator cbegin () const noexcept { return static_cast (getConstData ()); } diff --git a/src/beast/beast/module/core/native/posix_SharedCode.h b/src/beast/beast/module/core/native/posix_SharedCode.h index e4036ae4f3..c1d18bce19 100644 --- a/src/beast/beast/module/core/native/posix_SharedCode.h +++ b/src/beast/beast/module/core/native/posix_SharedCode.h @@ -104,10 +104,10 @@ namespace { #if BEAST_LINUX || \ (BEAST_IOS && ! __DARWIN_ONLY_64_BIT_INO_T) // (this iOS stuff is to avoid a simulator bug) - typedef struct stat64 beast_statStruct; + using beast_statStruct = struct stat64; #define BEAST_STAT stat64 #else - typedef struct stat beast_statStruct; + using beast_statStruct = struct stat; #define BEAST_STAT stat #endif diff --git a/src/beast/beast/module/core/system/SystemStats.h b/src/beast/beast/module/core/system/SystemStats.h index b325abefdf..81e1ccf802 100644 --- a/src/beast/beast/module/core/system/SystemStats.h +++ b/src/beast/beast/module/core/system/SystemStats.h @@ -52,7 +52,7 @@ namespace SystemStats getStackBacktrace(); /** A void() function type, used by setApplicationCrashHandler(). */ - typedef void (*CrashHandlerFunction)(); + using CrashHandlerFunction = void (*)(); /** Sets up a global callback function that will be called if the application executes some kind of illegal instruction. diff --git a/src/beast/beast/module/core/thread/DeadlineTimer.cpp b/src/beast/beast/module/core/thread/DeadlineTimer.cpp index 9685277543..740b97e23a 100644 --- a/src/beast/beast/module/core/thread/DeadlineTimer.cpp +++ b/src/beast/beast/module/core/thread/DeadlineTimer.cpp @@ -26,8 +26,8 @@ class DeadlineTimer::Manager : protected Thread { private: - typedef CriticalSection LockType; - typedef List Items; + using LockType = CriticalSection; + using Items = List ; public: Manager () : Thread ("DeadlineTimer::Manager") diff --git a/src/beast/beast/module/core/threads/CriticalSection.h b/src/beast/beast/module/core/threads/CriticalSection.h index 9120b0ee72..8d5eb96bd1 100644 --- a/src/beast/beast/module/core/threads/CriticalSection.h +++ b/src/beast/beast/module/core/threads/CriticalSection.h @@ -92,13 +92,13 @@ public: //============================================================================== /** Provides the type of scoped lock to use with a CriticalSection. */ - typedef GenericScopedLock ScopedLockType; + using ScopedLockType = GenericScopedLock ; /** Provides the type of scoped unlocker to use with a CriticalSection. */ - typedef GenericScopedUnlock ScopedUnlockType; + using ScopedUnlockType = GenericScopedUnlock ; /** Provides the type of scoped try-locker to use with a CriticalSection. */ - typedef GenericScopedTryLock ScopedTryLockType; + using ScopedTryLockType = GenericScopedTryLock ; //-------------------------------------------------------------------------- // @@ -161,7 +161,7 @@ public: }; /** A dummy scoped-unlocker type to use with a dummy critical section. */ - typedef ScopedLockType ScopedUnlockType; + using ScopedUnlockType = ScopedLockType; }; //============================================================================== @@ -187,7 +187,7 @@ public: @see CriticalSection, ScopedUnlock */ -typedef CriticalSection::ScopedLockType ScopedLock; +using ScopedLock = CriticalSection::ScopedLockType; //============================================================================== /** @@ -227,7 +227,7 @@ typedef CriticalSection::ScopedLockType ScopedLock; @see CriticalSection, ScopedLock */ -typedef CriticalSection::ScopedUnlockType ScopedUnlock; +using ScopedUnlock = CriticalSection::ScopedUnlockType; //============================================================================== /** @@ -260,7 +260,7 @@ typedef CriticalSection::ScopedUnlockType ScopedUnlock; @see CriticalSection::tryEnter, ScopedLock, ScopedUnlock, ScopedReadLock */ -typedef CriticalSection::ScopedTryLockType ScopedTryLock; +using ScopedTryLock = CriticalSection::ScopedTryLockType; } // beast diff --git a/src/beast/beast/module/core/time/AtExitHook.cpp b/src/beast/beast/module/core/time/AtExitHook.cpp index fae8090d49..2ed6129f6e 100644 --- a/src/beast/beast/module/core/time/AtExitHook.cpp +++ b/src/beast/beast/module/core/time/AtExitHook.cpp @@ -86,8 +86,8 @@ private: } }; - typedef CriticalSection MutexType; - typedef MutexType::ScopedLockType ScopedLockType; + using MutexType = CriticalSection; + using ScopedLockType = MutexType::ScopedLockType; static StaticDestructor s_staticDestructor; diff --git a/src/beast/beast/module/core/time/Time.cpp b/src/beast/beast/module/core/time/Time.cpp index bbf9e38d24..40b18aec04 100644 --- a/src/beast/beast/module/core/time/Time.cpp +++ b/src/beast/beast/module/core/time/Time.cpp @@ -92,11 +92,11 @@ namespace TimeHelpers static inline String formatString (const String& format, const struct tm* const tm) { #if BEAST_ANDROID - typedef CharPointer_UTF8 StringType; + using StringType = CharPointer_UTF8; #elif BEAST_WINDOWS - typedef CharPointer_UTF16 StringType; + using StringType = CharPointer_UTF16; #else - typedef CharPointer_UTF32 StringType; + using StringType = CharPointer_UTF32; #endif for (size_t bufferSize = 256; ; bufferSize += 256) diff --git a/src/beast/beast/net/DynamicBuffer.h b/src/beast/beast/net/DynamicBuffer.h index 04bcb8f288..0e4a733d81 100644 --- a/src/beast/beast/net/DynamicBuffer.h +++ b/src/beast/beast/net/DynamicBuffer.h @@ -36,7 +36,7 @@ public: defaultBlocksize = 32 * 1024 }; - typedef std::size_t size_type; + using size_type = std::size_t; /** Create the dynamic buffer with the specified block size. */ explicit DynamicBuffer (size_type blocksize = defaultBlocksize); @@ -116,7 +116,7 @@ public: std::string to_string () const; private: - typedef std::vector Buffers; + using Buffers = std::vector ; size_type m_blocksize; size_type m_size; diff --git a/src/beast/beast/net/IPAddressV4.h b/src/beast/beast/net/IPAddressV4.h index 5a811c2124..bd1a6359bd 100644 --- a/src/beast/beast/net/IPAddressV4.h +++ b/src/beast/beast/net/IPAddressV4.h @@ -109,8 +109,8 @@ struct AddressV4 class Proxy { public: - typedef typename std::conditional < - IsConst, std::uint32_t const*, std::uint32_t*>::type Pointer; + using Pointer = typename std::conditional < + IsConst, std::uint32_t const*, std::uint32_t*>::type; Proxy (int shift, Pointer value) : m_shift (shift) diff --git a/src/beast/beast/net/IPEndpoint.h b/src/beast/beast/net/IPEndpoint.h index 4cdbbdab20..6e3961a3c1 100644 --- a/src/beast/beast/net/IPEndpoint.h +++ b/src/beast/beast/net/IPEndpoint.h @@ -30,7 +30,7 @@ namespace beast { namespace IP { -typedef std::uint16_t Port; +using Port = std::uint16_t; /** A version-independent IP address and port combination. */ class Endpoint diff --git a/src/beast/beast/smart_ptr/SharedObject.h b/src/beast/beast/smart_ptr/SharedObject.h index c26db20ac1..cfa4ee6275 100644 --- a/src/beast/beast/smart_ptr/SharedObject.h +++ b/src/beast/beast/smart_ptr/SharedObject.h @@ -42,9 +42,9 @@ namespace beast { { void foo(); - // This is a neat way of declaring a typedef for a pointer class, + // This is a neat way of declaring a using Ptr = for a pointer class, // rather than typing out the full templated name each time.. - typedef SharedPtr Ptr; + using Ptr = SharedPtr; }; MyClass::Ptr p = new MyClass(); diff --git a/src/beast/beast/smart_ptr/SharedPtr.h b/src/beast/beast/smart_ptr/SharedPtr.h index 7201cc2c0b..db092d4abb 100644 --- a/src/beast/beast/smart_ptr/SharedPtr.h +++ b/src/beast/beast/smart_ptr/SharedPtr.h @@ -48,12 +48,12 @@ namespace beast { reference-countable class by implementing a pair of methods called incReferenceCount() and decReferenceCount(). - When using this class, you'll probably want to create a typedef to + When using this class, you'll probably want to create a using MyClassPtr = to abbreviate the full templated name - e.g. @code - typedef SharedPtr MyClassPtr; + using MyClassPtr = SharedPtr ; @endcode @@ -63,10 +63,10 @@ template class SharedPtr { public: - typedef T value_type; + using value_type = T; /** The class being referenced by this container. */ - typedef T ReferencedType; + using ReferencedType = T; /** Construct a container pointing to nothing. */ SharedPtr () noexcept diff --git a/src/beast/beast/streams/abstract_ostream.h b/src/beast/beast/streams/abstract_ostream.h index a99c9171c3..b4275feff9 100644 --- a/src/beast/beast/streams/abstract_ostream.h +++ b/src/beast/beast/streams/abstract_ostream.h @@ -25,7 +25,7 @@ namespace beast { /** An abstract ostream for `char`. */ -typedef basic_abstract_ostream abstract_ostream; +using abstract_ostream = basic_abstract_ostream ; } diff --git a/src/beast/beast/streams/basic_abstract_ostream.h b/src/beast/beast/streams/basic_abstract_ostream.h index 7d1932a5e1..82341b7880 100644 --- a/src/beast/beast/streams/basic_abstract_ostream.h +++ b/src/beast/beast/streams/basic_abstract_ostream.h @@ -36,8 +36,8 @@ template < class basic_abstract_ostream { public: - typedef std::basic_string string_type; - typedef basic_scoped_ostream scoped_stream_type; + using string_type = std::basic_string ; + using scoped_stream_type = basic_scoped_ostream ; basic_abstract_ostream() = default; diff --git a/src/beast/beast/streams/basic_scoped_ostream.h b/src/beast/beast/streams/basic_scoped_ostream.h index 861cf01291..bb403d4eec 100644 --- a/src/beast/beast/streams/basic_scoped_ostream.h +++ b/src/beast/beast/streams/basic_scoped_ostream.h @@ -54,11 +54,11 @@ template < class basic_scoped_ostream { private: - typedef std::function const&)> handler_t; + using handler_t = std::function const&)>; - typedef std::basic_ostringstream < - CharT, Traits, Allocator> stream_type; + using stream_type = std::basic_ostringstream < + CharT, Traits, Allocator>; handler_t m_handler; @@ -81,7 +81,7 @@ private: #endif public: - typedef std::basic_string string_type; + using string_type = std::basic_string ; // Disallow copy since that would duplicate the output basic_scoped_ostream (basic_scoped_ostream const&) = delete; diff --git a/src/beast/beast/streams/basic_std_ostream.h b/src/beast/beast/streams/basic_std_ostream.h index d47839ca8c..316d53a4d4 100644 --- a/src/beast/beast/streams/basic_std_ostream.h +++ b/src/beast/beast/streams/basic_std_ostream.h @@ -53,7 +53,7 @@ public: } }; -typedef basic_std_ostream std_ostream; +using std_ostream = basic_std_ostream ; //------------------------------------------------------------------------------ diff --git a/src/beast/beast/strings/CharPointer_ASCII.h b/src/beast/beast/strings/CharPointer_ASCII.h index 3970bc7252..18e8bf6ec9 100644 --- a/src/beast/beast/strings/CharPointer_ASCII.h +++ b/src/beast/beast/strings/CharPointer_ASCII.h @@ -45,7 +45,7 @@ namespace beast { class CharPointer_ASCII { public: - typedef char CharType; + using CharType = char; inline explicit CharPointer_ASCII (const CharType* const rawPointer) noexcept : data (const_cast (rawPointer)) diff --git a/src/beast/beast/strings/CharPointer_UTF16.h b/src/beast/beast/strings/CharPointer_UTF16.h index 400108e9f4..9c0a511a17 100644 --- a/src/beast/beast/strings/CharPointer_UTF16.h +++ b/src/beast/beast/strings/CharPointer_UTF16.h @@ -42,9 +42,9 @@ class CharPointer_UTF16 { public: #if BEAST_NATIVE_WCHAR_IS_UTF16 - typedef wchar_t CharType; + using CharType = wchar_t; #else - typedef std::int16_t CharType; + using CharType = std::int16_t; #endif inline explicit CharPointer_UTF16 (const CharType* const rawPointer) noexcept diff --git a/src/beast/beast/strings/CharPointer_UTF32.h b/src/beast/beast/strings/CharPointer_UTF32.h index 9b0f36e679..18c98eff6b 100644 --- a/src/beast/beast/strings/CharPointer_UTF32.h +++ b/src/beast/beast/strings/CharPointer_UTF32.h @@ -41,7 +41,7 @@ namespace beast { class CharPointer_UTF32 { public: - typedef beast_wchar CharType; + using CharType = beast_wchar; inline explicit CharPointer_UTF32 (const CharType* const rawPointer) noexcept : data (const_cast (rawPointer)) diff --git a/src/beast/beast/strings/CharPointer_UTF8.h b/src/beast/beast/strings/CharPointer_UTF8.h index f8f28c2903..3be82e5284 100644 --- a/src/beast/beast/strings/CharPointer_UTF8.h +++ b/src/beast/beast/strings/CharPointer_UTF8.h @@ -42,7 +42,7 @@ namespace beast { class CharPointer_UTF8 { public: - typedef char CharType; + using CharType = char; inline explicit CharPointer_UTF8 (const CharType* const rawPointer) noexcept : data (const_cast (rawPointer)) diff --git a/src/beast/beast/strings/CharacterFunctions.h b/src/beast/beast/strings/CharacterFunctions.h index b3037e24c9..e3de00c8a5 100644 --- a/src/beast/beast/strings/CharacterFunctions.h +++ b/src/beast/beast/strings/CharacterFunctions.h @@ -49,9 +49,9 @@ namespace beast { #if BEAST_NATIVE_WCHAR_IS_UTF32 || DOXYGEN /** A platform-independent 32-bit unicode character type. */ - typedef wchar_t beast_wchar; + using beast_wchar = wchar_t; #else - typedef std::uint32_t beast_wchar; + using beast_wchar = std::uint32_t; #endif #ifndef DOXYGEN diff --git a/src/beast/beast/strings/String.h b/src/beast/beast/strings/String.h index 8924910874..bad0fdc677 100644 --- a/src/beast/beast/strings/String.h +++ b/src/beast/beast/strings/String.h @@ -49,11 +49,11 @@ namespace beast { #if BEAST_NATIVE_WCHAR_IS_UTF8 - typedef CharPointer_UTF8 CharPointer_wchar_t; + using CharPointer_wchar_t = CharPointer_UTF8; #elif BEAST_NATIVE_WCHAR_IS_UTF16 - typedef CharPointer_UTF16 CharPointer_wchar_t; + using CharPointer_wchar_t = CharPointer_UTF16; #else - typedef CharPointer_UTF32 CharPointer_wchar_t; + using CharPointer_wchar_t = CharPointer_UTF32; #endif //============================================================================== @@ -186,7 +186,7 @@ public: static const String empty; /** This is the character encoding type used internally to store the string. */ - typedef StringCharPointerType CharPointerType; + using CharPointerType = StringCharPointerType; //============================================================================== /** Generates a probably-unique 32-bit hashcode from this string. */ diff --git a/src/beast/beast/strings/StringCharPointerType.h b/src/beast/beast/strings/StringCharPointerType.h index ec9f457378..8468530ea7 100644 --- a/src/beast/beast/strings/StringCharPointerType.h +++ b/src/beast/beast/strings/StringCharPointerType.h @@ -44,13 +44,13 @@ namespace beast { toUTF32() methods let you access the string's content in any of the other formats. */ #if (BEAST_STRING_UTF_TYPE == 32) -typedef CharPointer_UTF32 StringCharPointerType; +using StringCharPointerType = CharPointer_UTF32; #elif (BEAST_STRING_UTF_TYPE == 16) -typedef CharPointer_UTF16 StringCharPointerType; +using StringCharPointerType = CharPointer_UTF16; #elif (BEAST_STRING_UTF_TYPE == 8) -typedef CharPointer_UTF8 StringCharPointerType; +using StringCharPointerType = CharPointer_UTF8; #else #error "You must set the value of BEAST_STRING_UTF_TYPE to be either 8, 16, or 32!" diff --git a/src/beast/beast/strings/impl/String.cpp b/src/beast/beast/strings/impl/String.cpp index a25d1340b9..dbe1595edd 100644 --- a/src/beast/beast/strings/impl/String.cpp +++ b/src/beast/beast/strings/impl/String.cpp @@ -82,8 +82,8 @@ public: text[0] = 0; } - typedef String::CharPointerType CharPointerType; - typedef String::CharPointerType::CharType CharType; + using CharPointerType = String::CharPointerType; + using CharType = String::CharPointerType::CharType; //============================================================================== static CharPointerType createUninitialisedBytes (const size_t numBytes) @@ -1872,7 +1872,7 @@ struct StringEncodingConverter { String& source = const_cast (s); - typedef typename CharPointerType_Dest::CharType DestChar; + using DestChar = typename CharPointerType_Dest::CharType; if (source.isEmpty()) return CharPointerType_Dest (reinterpret_cast (&emptyChar)); diff --git a/src/beast/beast/threads/RecursiveMutex.h b/src/beast/beast/threads/RecursiveMutex.h index 129377cfa0..57edf8cecd 100644 --- a/src/beast/beast/threads/RecursiveMutex.h +++ b/src/beast/beast/threads/RecursiveMutex.h @@ -39,9 +39,9 @@ namespace beast { class RecursiveMutex { public: - typedef std::lock_guard ScopedLockType; - typedef UnlockGuard ScopedUnlockType; - typedef TryLockGuard ScopedTryLockType; + using ScopedLockType = std::lock_guard ; + using ScopedUnlockType = UnlockGuard ; + using ScopedTryLockType = TryLockGuard ; /** Create the mutex. The mutux is initially unowned. diff --git a/src/beast/beast/threads/ScopedWrapperContext.h b/src/beast/beast/threads/ScopedWrapperContext.h index ac7dee6688..1505f836bc 100644 --- a/src/beast/beast/threads/ScopedWrapperContext.h +++ b/src/beast/beast/threads/ScopedWrapperContext.h @@ -56,8 +56,8 @@ template class ScopedWrapperContext { public: - typedef Context context_type; - typedef ScopedType scoped_type; + using context_type = Context; + using scoped_type = ScopedType; class Scope { diff --git a/src/beast/beast/threads/SharedData.h b/src/beast/beast/threads/SharedData.h index d58976a5b5..9c64129878 100644 --- a/src/beast/beast/threads/SharedData.h +++ b/src/beast/beast/threads/SharedData.h @@ -72,7 +72,7 @@ namespace beast { String value2; }; - typedef SharedData SharedState; + using SharedState = SharedData ; SharedState m_state; @@ -113,11 +113,11 @@ template class SharedLockGuard { public: - typedef Mutex MutexType; + using MutexType = Mutex; explicit SharedLockGuard (Mutex const& mutex) : m_mutex (mutex) diff --git a/src/beast/beast/threads/SharedMutexAdapter.h b/src/beast/beast/threads/SharedMutexAdapter.h index 4cf3f03ec8..06e443da16 100644 --- a/src/beast/beast/threads/SharedMutexAdapter.h +++ b/src/beast/beast/threads/SharedMutexAdapter.h @@ -35,9 +35,9 @@ template class SharedMutexAdapter { public: - typedef Mutex MutexType; - typedef std::lock_guard LockGuardType; - typedef SharedLockGuard SharedLockGuardType; + using MutexType = Mutex; + using LockGuardType = std::lock_guard ; + using SharedLockGuardType = SharedLockGuard ; void lock() const { diff --git a/src/beast/beast/threads/SpinLock.h b/src/beast/beast/threads/SpinLock.h index 733f4f51c8..4d517da23b 100644 --- a/src/beast/beast/threads/SpinLock.h +++ b/src/beast/beast/threads/SpinLock.h @@ -50,10 +50,10 @@ class SpinLock { public: /** Provides the type of scoped lock to use for locking a SpinLock. */ - typedef std::lock_guard ScopedLockType; + using ScopedLockType = std::lock_guard ; /** Provides the type of scoped unlocker to use with a SpinLock. */ - typedef UnlockGuard ScopedUnlockType; + using ScopedUnlockType = UnlockGuard ; SpinLock() : m_lock (0) diff --git a/src/beast/beast/threads/Stoppable.h b/src/beast/beast/threads/Stoppable.h index 70ee0ae92c..873ee2fb11 100644 --- a/src/beast/beast/threads/Stoppable.h +++ b/src/beast/beast/threads/Stoppable.h @@ -253,7 +253,7 @@ private: friend class RootStoppable; struct Child; - typedef LockFreeStack Children; + using Children = LockFreeStack ; struct Child : Children::Node { diff --git a/src/beast/beast/threads/TryLockGuard.h b/src/beast/beast/threads/TryLockGuard.h index 4b70e9b2b9..adc53406fa 100644 --- a/src/beast/beast/threads/TryLockGuard.h +++ b/src/beast/beast/threads/TryLockGuard.h @@ -26,7 +26,7 @@ template class TryLockGuard { public: - typedef Mutex MutexType; + using MutexType = Mutex; explicit TryLockGuard (Mutex const& mutex) : m_mutex (mutex) diff --git a/src/beast/beast/threads/UnlockGuard.h b/src/beast/beast/threads/UnlockGuard.h index be87fef263..6007000d54 100644 --- a/src/beast/beast/threads/UnlockGuard.h +++ b/src/beast/beast/threads/UnlockGuard.h @@ -26,7 +26,7 @@ template class UnlockGuard { public: - typedef Mutex MutexType; + using MutexType = Mutex; explicit UnlockGuard (Mutex const& mutex) : m_mutex (mutex) diff --git a/src/beast/beast/threads/detail/DispatchedHandler.h b/src/beast/beast/threads/detail/DispatchedHandler.h index c4c303dd18..a18d51e409 100644 --- a/src/beast/beast/threads/detail/DispatchedHandler.h +++ b/src/beast/beast/threads/detail/DispatchedHandler.h @@ -34,7 +34,7 @@ private: Handler m_handler; public: - typedef void result_type; + using result_type = void; DispatchedHandler (Dispatcher dispatcher, Handler& handler) : m_dispatcher (dispatcher) diff --git a/src/beast/beast/threads/semaphore.h b/src/beast/beast/threads/semaphore.h index 096a057446..a0bff2fe5f 100644 --- a/src/beast/beast/threads/semaphore.h +++ b/src/beast/beast/threads/semaphore.h @@ -29,14 +29,14 @@ template class basic_semaphore { private: - typedef std::unique_lock scoped_lock; + using scoped_lock = std::unique_lock ; Mutex m_mutex; CondVar m_cond; std::size_t m_count; public: - typedef std::size_t size_type; + using size_type = std::size_t; /** Create the semaphore, with an optional initial count. If unspecified, the initial count is zero. @@ -79,7 +79,7 @@ public: } }; -typedef basic_semaphore semaphore; +using semaphore = basic_semaphore ; } #endif diff --git a/src/beast/beast/unit_test/suite.h b/src/beast/beast/unit_test/suite.h index 1b54a6ec6e..b88f19b985 100644 --- a/src/beast/beast/unit_test/suite.h +++ b/src/beast/beast/unit_test/suite.h @@ -141,7 +141,7 @@ public: Multiline output sent to the stream will be atomically written to the underlying abstract_Ostream */ - typedef abstract_ostream::scoped_stream_type scoped_stream; + using scoped_stream = abstract_ostream::scoped_stream_type; /** Memberspace for logging. */ log_t log; diff --git a/src/beast/beast/utility/PropertyStream.h b/src/beast/beast/utility/PropertyStream.h index d9ce7ad441..d81317310b 100644 --- a/src/beast/beast/utility/PropertyStream.h +++ b/src/beast/beast/utility/PropertyStream.h @@ -286,7 +286,7 @@ private: List children; }; - typedef SharedData SharedState; + using SharedState = SharedData ; std::string const m_name; SharedState m_state; diff --git a/src/beast/beast/utility/hash_pair.h b/src/beast/beast/utility/hash_pair.h index ded3afffc1..74c3bd44e6 100644 --- a/src/beast/beast/utility/hash_pair.h +++ b/src/beast/beast/utility/hash_pair.h @@ -35,8 +35,8 @@ struct hash > , private boost::base_from_member , 1> { private: - typedef boost::base_from_member , 0> first_hash; - typedef boost::base_from_member , 1> second_hash; + using first_hash = boost::base_from_member , 0>; + using second_hash = boost::base_from_member , 1>; public: hash () diff --git a/src/beast/beast/utility/impl/PropertyStream.cpp b/src/beast/beast/utility/impl/PropertyStream.cpp index bfbd028846..9f521fc1c8 100644 --- a/src/beast/beast/utility/impl/PropertyStream.cpp +++ b/src/beast/beast/utility/impl/PropertyStream.cpp @@ -604,7 +604,7 @@ void PropertyStream::add (long double value) class PropertyStream_test : public unit_test::suite { public: - typedef PropertyStream::Source Source; + using Source = PropertyStream::Source; void test_peel_name (std::string s, std::string const& expected, std::string const& expected_remainder) diff --git a/src/beast/beast/utility/is_call_possible.h b/src/beast/beast/utility/is_call_possible.h index 25d0dfd064..08b4c9e456 100644 --- a/src/beast/beast/utility/is_call_possible.h +++ b/src/beast/beast/utility/is_call_possible.h @@ -32,13 +32,13 @@ namespace is_call_possible_detail template struct add_reference { - typedef Z& type; + using type = Z&; }; template struct add_reference { - typedef Z& type; + using type = Z&; }; template class void_exp_result {}; @@ -52,13 +52,13 @@ namespace is_call_possible_detail template struct clone_constness { - typedef dest_type type; + using type = dest_type; }; template struct clone_constness { - typedef const dest_type type; + using type = const dest_type; }; } @@ -165,7 +165,7 @@ template struct trait_name \ { \ private: \ - typedef std::remove_reference_t
Z; \ + using Z = std::remove_reference_t
; \ class yes {}; \ class no { yes m[2]; }; \ struct derived : public Z \ @@ -175,7 +175,7 @@ private: private: derived (); \ }; \ \ - typedef typename beast::is_call_possible_detail::clone_constness::type derived_type; \ + using derived_type = typename beast::is_call_possible_detail::clone_constness::type; \ \ template \ struct return_value_check \ diff --git a/src/beast/beast/utility/maybe_const.h b/src/beast/beast/utility/maybe_const.h index 3fd63c3a6c..1de13373c4 100644 --- a/src/beast/beast/utility/maybe_const.h +++ b/src/beast/beast/utility/maybe_const.h @@ -28,9 +28,9 @@ namespace beast { template struct maybe_const { - typedef typename std::conditional ::type const, - typename std::remove_const ::type>::type type; + typename std::remove_const ::type>::type; }; /** Alias for omitting `typename`. */ diff --git a/src/beast/beast/utility/tagged_integer.h b/src/beast/beast/utility/tagged_integer.h index 3f9545c54c..83f00ccc55 100644 --- a/src/beast/beast/utility/tagged_integer.h +++ b/src/beast/beast/utility/tagged_integer.h @@ -53,8 +53,8 @@ private: Int m_value; public: - typedef Int value_type; - typedef Tag tag_type; + using value_type = Int; + using tag_type = Tag; tagged_integer() = default; diff --git a/src/beast/beast/utility/tests/empty_base_optimization.test.cpp b/src/beast/beast/utility/tests/empty_base_optimization.test.cpp index 10808df5ae..a4448a5831 100644 --- a/src/beast/beast/utility/tests/empty_base_optimization.test.cpp +++ b/src/beast/beast/utility/tests/empty_base_optimization.test.cpp @@ -35,7 +35,7 @@ public: class test1 : private empty_base_optimization { - typedef empty_base_optimization Base; + using Base = empty_base_optimization; void* m_p; public: explicit test1 (T const& t) diff --git a/src/beast/beast/utility/tests/static_initializer.test.cpp b/src/beast/beast/utility/tests/static_initializer.test.cpp index 39b2e99ad9..3a00085c58 100644 --- a/src/beast/beast/utility/tests/static_initializer.test.cpp +++ b/src/beast/beast/utility/tests/static_initializer.test.cpp @@ -38,7 +38,7 @@ public: struct Case { enum { count = N }; - typedef Tag type; + using type = Tag; }; struct Counts diff --git a/src/beast/beast/utility/tests/tagged_integer.test.cpp b/src/beast/beast/utility/tests/tagged_integer.test.cpp index a8b7e61197..2e011c0256 100644 --- a/src/beast/beast/utility/tests/tagged_integer.test.cpp +++ b/src/beast/beast/utility/tests/tagged_integer.test.cpp @@ -35,9 +35,9 @@ private: struct Tag1 { }; struct Tag2 { }; - typedef tagged_integer TagInt1; - typedef tagged_integer TagInt2; - typedef tagged_integer TagInt3; + using TagInt1 = tagged_integer ; + using TagInt2 = tagged_integer ; + using TagInt3 = tagged_integer ; // Check construction of tagged_integers static_assert (std::is_constructible::value, diff --git a/src/beast/beast/utility/type_name.h b/src/beast/beast/utility/type_name.h index fadf8d9076..039a3c86c3 100644 --- a/src/beast/beast/utility/type_name.h +++ b/src/beast/beast/utility/type_name.h @@ -42,7 +42,7 @@ template std::string type_name() { - typedef typename std::remove_reference::type TR; + using TR = typename std::remove_reference::type; std::unique_ptr own ( #ifndef _MSC_VER abi::__cxa_demangle (typeid(TR).name(), nullptr, diff --git a/src/beast/beast/weak_fn.h b/src/beast/beast/weak_fn.h index 67eb335d0e..b15982c1b4 100644 --- a/src/beast/beast/weak_fn.h +++ b/src/beast/beast/weak_fn.h @@ -90,7 +90,7 @@ class weak_binder : private beast::empty_base_optimization { private: - typedef R (T::*member_type)(Args...); + using member_type = R (T::*)(Args...); using pointer_type = std::weak_ptr; using shared_type = std::shared_ptr; member_type member_; diff --git a/src/ripple/app/ledger/AcceptedLedger.h b/src/ripple/app/ledger/AcceptedLedger.h index 694c6766bf..2878a207f0 100644 --- a/src/ripple/app/ledger/AcceptedLedger.h +++ b/src/ripple/app/ledger/AcceptedLedger.h @@ -43,11 +43,11 @@ namespace ripple { class AcceptedLedger { public: - typedef std::shared_ptr pointer; - typedef const pointer& ret; - typedef std::map map_t; // Must be an ordered map! - typedef map_t::value_type value_type; - typedef map_t::const_iterator const_iterator; + using pointer = std::shared_ptr; + using ret = const pointer&; + using map_t = std::map; // Must be an ordered map! + using value_type = map_t::value_type; + using const_iterator = map_t::const_iterator; public: static pointer makeAcceptedLedger (Ledger::ref ledger); diff --git a/src/ripple/app/ledger/AcceptedLedgerTx.h b/src/ripple/app/ledger/AcceptedLedgerTx.h index 47b7be9733..557288b850 100644 --- a/src/ripple/app/ledger/AcceptedLedgerTx.h +++ b/src/ripple/app/ledger/AcceptedLedgerTx.h @@ -46,8 +46,8 @@ namespace ripple { class AcceptedLedgerTx { public: - typedef std::shared_ptr pointer; - typedef const pointer& ref; + using pointer = std::shared_ptr ; + using ref = const pointer&; public: AcceptedLedgerTx (Ledger::ref ledger, SerialIter& sit); diff --git a/src/ripple/app/ledger/BookListeners.h b/src/ripple/app/ledger/BookListeners.h index 2f473e0a6c..f59d058ab5 100644 --- a/src/ripple/app/ledger/BookListeners.h +++ b/src/ripple/app/ledger/BookListeners.h @@ -29,7 +29,7 @@ namespace ripple { class BookListeners { public: - typedef std::shared_ptr pointer; + using pointer = std::shared_ptr; BookListeners () {} @@ -38,8 +38,8 @@ public: void publish (Json::Value const& jvObj); private: - typedef RippleRecursiveMutex LockType; - typedef std::lock_guard ScopedLockType; + using LockType = RippleRecursiveMutex; + using ScopedLockType = std::lock_guard ; LockType mLock; hash_map mListeners; diff --git a/src/ripple/app/ledger/ConsensusTransSetSF.h b/src/ripple/app/ledger/ConsensusTransSetSF.h index d6bf328ff3..55ad7a5db4 100644 --- a/src/ripple/app/ledger/ConsensusTransSetSF.h +++ b/src/ripple/app/ledger/ConsensusTransSetSF.h @@ -33,7 +33,7 @@ namespace ripple { class ConsensusTransSetSF : public SHAMapSyncFilter { public: - typedef TaggedCache NodeCache; + using NodeCache = TaggedCache ; // VFALCO TODO Use a dependency injection to get the temp node cache ConsensusTransSetSF (NodeCache& nodeCache); diff --git a/src/ripple/app/ledger/DisputedTx.h b/src/ripple/app/ledger/DisputedTx.h index 338f68ea24..2b09c02829 100644 --- a/src/ripple/app/ledger/DisputedTx.h +++ b/src/ripple/app/ledger/DisputedTx.h @@ -38,7 +38,7 @@ namespace ripple { class DisputedTx { public: - typedef std::shared_ptr pointer; + using pointer = std::shared_ptr ; DisputedTx (uint256 const& txID, Blob const& tx, diff --git a/src/ripple/app/ledger/InboundLedger.h b/src/ripple/app/ledger/InboundLedger.h index 1d72faaa32..802229c95a 100644 --- a/src/ripple/app/ledger/InboundLedger.h +++ b/src/ripple/app/ledger/InboundLedger.h @@ -37,8 +37,8 @@ class InboundLedger public: static char const* getCountedObjectName () { return "InboundLedger"; } - typedef std::shared_ptr pointer; - typedef std::pair < std::weak_ptr, std::shared_ptr > PeerDataPairType; + using pointer = std::shared_ptr ; + using PeerDataPairType = std::pair < std::weak_ptr, std::shared_ptr >; // These are the reasons we might acquire a ledger enum fcReason @@ -98,7 +98,7 @@ public: bool gotData (std::weak_ptr, std::shared_ptr); - typedef std::pair neededHash_t; + using neededHash_t = std::pair ; std::vector getNeededHashes (); diff --git a/src/ripple/app/ledger/InboundLedgers.cpp b/src/ripple/app/ledger/InboundLedgers.cpp index 5a16f7f682..3109c0219f 100644 --- a/src/ripple/app/ledger/InboundLedgers.cpp +++ b/src/ripple/app/ledger/InboundLedgers.cpp @@ -39,7 +39,7 @@ private: DecayWindow<30, clock_type> fetchRate_; public: - typedef std::pair u256_acq_pair; + using u256_acq_pair = std::pair; // How long before we try again to acquire the same ledger static const int kReacquireIntervalSeconds = 300; @@ -381,10 +381,10 @@ public: private: clock_type& m_clock; - typedef hash_map MapType; + using MapType = hash_map ; - typedef RippleRecursiveMutex LockType; - typedef std::unique_lock ScopedLockType; + using LockType = RippleRecursiveMutex; + using ScopedLockType = std::unique_lock ; LockType mLock; MapType mLedgers; diff --git a/src/ripple/app/ledger/InboundLedgers.h b/src/ripple/app/ledger/InboundLedgers.h index b7734611f9..31d95d4d83 100644 --- a/src/ripple/app/ledger/InboundLedgers.h +++ b/src/ripple/app/ledger/InboundLedgers.h @@ -34,7 +34,7 @@ namespace ripple { class InboundLedgers { public: - typedef beast::abstract_clock clock_type; + using clock_type = beast::abstract_clock ; virtual ~InboundLedgers() = 0; diff --git a/src/ripple/app/ledger/Ledger.h b/src/ripple/app/ledger/Ledger.h index ba8d07f92f..126a5b77bc 100644 --- a/src/ripple/app/ledger/Ledger.h +++ b/src/ripple/app/ledger/Ledger.h @@ -79,8 +79,8 @@ class Ledger public: static char const* getCountedObjectName () { return "Ledger"; } - typedef std::shared_ptr pointer; - typedef const std::shared_ptr& ref; + using pointer = std::shared_ptr; + using ref = const std::shared_ptr&; enum TransResult { @@ -333,7 +333,7 @@ public: // Ledger hash table function uint256 getLedgerHash (std::uint32_t ledgerIndex); - typedef std::vector> LedgerHashes; + using LedgerHashes = std::vector>; LedgerHashes getLedgerHashes () const; std::vector getLedgerAmendments () const; diff --git a/src/ripple/app/ledger/LedgerCleaner.cpp b/src/ripple/app/ledger/LedgerCleaner.cpp index 75da212f51..2f0068030d 100644 --- a/src/ripple/app/ledger/LedgerCleaner.cpp +++ b/src/ripple/app/ledger/LedgerCleaner.cpp @@ -70,7 +70,7 @@ public: int failures; // Number of errors encountered since last success }; - typedef beast::SharedData SharedState; + using SharedState = beast::SharedData ; SharedState m_state; beast::Journal m_journal; diff --git a/src/ripple/app/ledger/LedgerEntrySet.h b/src/ripple/app/ledger/LedgerEntrySet.h index 27b57aa07c..887ec0e260 100644 --- a/src/ripple/app/ledger/LedgerEntrySet.h +++ b/src/ripple/app/ledger/LedgerEntrySet.h @@ -246,8 +246,8 @@ public: void calcRawMeta (Serializer&, TER result, std::uint32_t index); // iterator functions - typedef std::map::iterator iterator; - typedef std::map::const_iterator const_iterator; + using iterator = std::map::iterator; + using const_iterator = std::map::const_iterator; bool empty () const { @@ -297,7 +297,7 @@ private: // Defers credits made to accounts until later boost::optional mDeferredCredits; - typedef hash_map NodeToLedgerEntry; + using NodeToLedgerEntry = hash_map; TransactionMetaSet mSet; TransactionEngineParams mParams; diff --git a/src/ripple/app/ledger/LedgerHistory.h b/src/ripple/app/ledger/LedgerHistory.h index 05bf8ed1b1..f556f0d0f1 100644 --- a/src/ripple/app/ledger/LedgerHistory.h +++ b/src/ripple/app/ledger/LedgerHistory.h @@ -109,7 +109,7 @@ private: beast::insight::Collector::ptr collector_; beast::insight::Counter mismatch_counter_; - typedef TaggedCache LedgersByHash; + using LedgersByHash = TaggedCache ; LedgersByHash m_ledgers_by_hash; @@ -117,8 +117,8 @@ private: // For debug and logging purposes // 1) The hash of a ledger with that index we build // 2) The hash of a ledger with that index we validated - typedef TaggedCache > ConsensusValidated; + using ConsensusValidated = TaggedCache >; ConsensusValidated m_consensus_validated; diff --git a/src/ripple/app/ledger/LedgerHolder.h b/src/ripple/app/ledger/LedgerHolder.h index aaa2554d26..417fb3f98e 100644 --- a/src/ripple/app/ledger/LedgerHolder.h +++ b/src/ripple/app/ledger/LedgerHolder.h @@ -29,8 +29,8 @@ namespace ripple { class LedgerHolder { public: - typedef RippleMutex LockType; - typedef std::lock_guard ScopedLockType; + using LockType = RippleMutex; + using ScopedLockType = std::lock_guard ; // Update the held ledger void set (Ledger::pointer ledger) diff --git a/src/ripple/app/ledger/LedgerMaster.cpp b/src/ripple/app/ledger/LedgerMaster.cpp index 25b71439c0..7a812cfd09 100644 --- a/src/ripple/app/ledger/LedgerMaster.cpp +++ b/src/ripple/app/ledger/LedgerMaster.cpp @@ -54,11 +54,11 @@ class LedgerMasterImp : public LedgerMaster { public: - typedef std::function callback; + using callback = std::function ; - typedef RippleRecursiveMutex LockType; - typedef std::lock_guard ScopedLockType; - typedef beast::GenericScopedUnlock ScopedUnlockType; + using LockType = RippleRecursiveMutex; + using ScopedLockType = std::lock_guard ; + using ScopedUnlockType = beast::GenericScopedUnlock ; beast::Journal m_journal; diff --git a/src/ripple/app/ledger/LedgerMaster.h b/src/ripple/app/ledger/LedgerMaster.h index afcae35d8f..51607b3e12 100644 --- a/src/ripple/app/ledger/LedgerMaster.h +++ b/src/ripple/app/ledger/LedgerMaster.h @@ -45,12 +45,12 @@ protected: explicit LedgerMaster (Stoppable& parent); public: - typedef std::function callback; + using callback = std::function ; public: - typedef RippleRecursiveMutex LockType; - typedef std::unique_lock ScopedLockType; - typedef beast::GenericScopedUnlock ScopedUnlockType; + using LockType = RippleRecursiveMutex; + using ScopedLockType = std::unique_lock ; + using ScopedUnlockType = beast::GenericScopedUnlock ; virtual ~LedgerMaster () = 0; diff --git a/src/ripple/app/ledger/LedgerProposal.h b/src/ripple/app/ledger/LedgerProposal.h index 63f9efd417..ee4e1c3f51 100644 --- a/src/ripple/app/ledger/LedgerProposal.h +++ b/src/ripple/app/ledger/LedgerProposal.h @@ -38,8 +38,8 @@ public: static const std::uint32_t seqLeave = 0xffffffff; // leaving the consensus process - typedef std::shared_ptr pointer; - typedef const pointer& ref; + using pointer = std::shared_ptr; + using ref = const pointer&; // proposal from peer LedgerProposal (uint256 const& prevLgr, std::uint32_t proposeSeq, uint256 const& propose, diff --git a/src/ripple/app/ledger/OrderBookDB.h b/src/ripple/app/ledger/OrderBookDB.h index 897377802a..2a4d9aa03f 100644 --- a/src/ripple/app/ledger/OrderBookDB.h +++ b/src/ripple/app/ledger/OrderBookDB.h @@ -56,7 +56,7 @@ public: Ledger::ref ledger, const AcceptedLedgerTx& alTx, Json::Value const& jvObj); - typedef hash_map IssueToOrderBook; + using IssueToOrderBook = hash_map ; private: void rawAddBook(Book const&); @@ -70,12 +70,11 @@ private: // does an order book to XRP exist hash_set mXRPBooks; - typedef RippleRecursiveMutex LockType; - typedef std::lock_guard ScopedLockType; + using LockType = RippleRecursiveMutex; + using ScopedLockType = std::lock_guard ; LockType mLock; - typedef hash_map - BookToListenersMap; + using BookToListenersMap = hash_map ; BookToListenersMap mListeners; diff --git a/src/ripple/app/main/LoadManager.cpp b/src/ripple/app/main/LoadManager.cpp index 33cadb9b39..0d69ca688c 100644 --- a/src/ripple/app/main/LoadManager.cpp +++ b/src/ripple/app/main/LoadManager.cpp @@ -41,7 +41,7 @@ public: beast::Journal m_journal; using LockType = std::mutex; - typedef std::lock_guard ScopedLockType; + using ScopedLockType = std::lock_guard ; LockType mLock; bool mArmed; diff --git a/src/ripple/app/misc/AccountState.h b/src/ripple/app/misc/AccountState.h index 47d277c489..6583d757f4 100644 --- a/src/ripple/app/misc/AccountState.h +++ b/src/ripple/app/misc/AccountState.h @@ -34,7 +34,7 @@ namespace ripple { class AccountState { public: - typedef std::shared_ptr pointer; + using pointer = std::shared_ptr; public: // For new accounts diff --git a/src/ripple/app/misc/AmendmentTableImpl.cpp b/src/ripple/app/misc/AmendmentTableImpl.cpp index 0d1d9b79a0..c6b1c3fda3 100644 --- a/src/ripple/app/misc/AmendmentTableImpl.cpp +++ b/src/ripple/app/misc/AmendmentTableImpl.cpp @@ -39,11 +39,11 @@ template class AmendmentTableImpl final : public AmendmentTable { protected: - typedef hash_map amendmentMap_t; - typedef hash_set amendmentList_t; + using amendmentMap_t = hash_map; + using amendmentList_t = hash_set; - typedef RippleMutex LockType; - typedef std::lock_guard ScopedLockType; + using LockType = RippleMutex; + using ScopedLockType = std::lock_guard ; LockType mLock; amendmentMap_t m_amendmentMap; @@ -410,7 +410,7 @@ AmendmentTableImpl::reportValidations (const AmendmentSet& set) int threshold = (set.mTrustedValidations * mMajorityFraction) / 256; - typedef std::map::value_type u256_int_pair; + using u256_int_pair = std::map::value_type; ScopedLockType sl (mLock); diff --git a/src/ripple/app/misc/CanonicalTXSet.h b/src/ripple/app/misc/CanonicalTXSet.h index 447785d61a..9ae7cf0799 100644 --- a/src/ripple/app/misc/CanonicalTXSet.h +++ b/src/ripple/app/misc/CanonicalTXSet.h @@ -71,8 +71,8 @@ public: std::uint32_t mSeq; }; - typedef std::map ::iterator iterator; - typedef std::map ::const_iterator const_iterator; + using iterator = std::map ::iterator; + using const_iterator = std::map ::const_iterator; public: explicit CanonicalTXSet (LedgerHash const& lastClosedLedgerHash) diff --git a/src/ripple/app/misc/FeeVoteImpl.cpp b/src/ripple/app/misc/FeeVoteImpl.cpp index 5c077c41ec..3a2c6c6ba7 100644 --- a/src/ripple/app/misc/FeeVoteImpl.cpp +++ b/src/ripple/app/misc/FeeVoteImpl.cpp @@ -32,7 +32,7 @@ template class VotableInteger { private: - typedef std::map map_type; + using map_type = std::map ; Integer mCurrent; // The current setting Integer mTarget; // The setting we want map_type mVoteMap; diff --git a/src/ripple/app/misc/IHashRouter.h b/src/ripple/app/misc/IHashRouter.h index 120c8a4b1e..b7f513400e 100644 --- a/src/ripple/app/misc/IHashRouter.h +++ b/src/ripple/app/misc/IHashRouter.h @@ -46,7 +46,7 @@ class IHashRouter { public: // The type here *MUST* match the type of Peer::id_t - typedef std::uint32_t PeerShortID; + using PeerShortID = std::uint32_t; // VFALCO NOTE this preferred alternative to default parameters makes // behavior clear. diff --git a/src/ripple/app/misc/NetworkOPs.cpp b/src/ripple/app/misc/NetworkOPs.cpp index a5bf4fa795..3509753845 100644 --- a/src/ripple/app/misc/NetworkOPs.cpp +++ b/src/ripple/app/misc/NetworkOPs.cpp @@ -206,7 +206,7 @@ public: // // Must complete immediately. - typedef std::function stCallback; + using stCallback = std::function; void submitTransaction ( Job&, STTx::pointer, stCallback callback = stCallback ()) override; @@ -537,12 +537,12 @@ private: private: clock_type& m_clock; - typedef hash_map SubInfoMapType; - typedef hash_map subRpcMapType; + using SubInfoMapType = hash_map ; + using subRpcMapType = hash_map; // XXX Split into more locks. - typedef RippleRecursiveMutex LockType; - typedef std::lock_guard ScopedLockType; + using LockType = RippleRecursiveMutex; + using ScopedLockType = std::lock_guard ; beast::Journal m_journal; @@ -1316,7 +1316,7 @@ bool NetworkOPsImp::checkLastClosedLedger ( auto current = getApp().getValidations ().getCurrentValidations ( closedLedger, prevClosedLedger); - typedef std::map::value_type u256_cvc_pair; + using u256_cvc_pair = std::map::value_type; for (auto & it: current) { ValidationCount& vc = ledgers[it.first]; diff --git a/src/ripple/app/misc/NetworkOPs.h b/src/ripple/app/misc/NetworkOPs.h index 8627f4ae0b..3898561e27 100644 --- a/src/ripple/app/misc/NetworkOPs.h +++ b/src/ripple/app/misc/NetworkOPs.h @@ -72,7 +72,7 @@ protected: explicit NetworkOPs (Stoppable& parent); public: - typedef beast::abstract_clock clock_type; + using clock_type = beast::abstract_clock ; enum Fault { @@ -103,7 +103,7 @@ public: // VFALCO TODO Fix OrderBookDB to not need this unrelated type. // - typedef hash_map SubMapType; + using SubMapType = hash_map ; public: virtual ~NetworkOPs () = 0; @@ -156,7 +156,7 @@ public: // must complete immediately // VFALCO TODO Make this a TxCallback structure - typedef std::function stCallback; + using stCallback = std::function; virtual void submitTransaction (Job&, STTx::pointer, stCallback callback = stCallback ()) = 0; virtual Transaction::pointer processTransactionCb (Transaction::pointer, @@ -266,7 +266,7 @@ public: virtual Json::Value getLedgerFetchInfo () = 0; virtual std::uint32_t acceptLedger () = 0; - typedef hash_map > Proposals; + using Proposals = hash_map >; virtual Proposals& peekStoredProposals () = 0; virtual void storeProposal (LedgerProposal::ref proposal, @@ -287,10 +287,8 @@ public: bool count, bool bAdmin) = 0; // client information retrieval functions - typedef std::pair - AccountTx; - - typedef std::vector AccountTxs; + using AccountTx = std::pair; + using AccountTxs = std::vector; virtual AccountTxs getAccountTxs ( RippleAddress const& account, @@ -302,10 +300,8 @@ public: std::int32_t minLedger, std::int32_t maxLedger, bool forward, Json::Value& token, int limit, bool bAdmin) = 0; - typedef std::tuple - txnMetaLedgerType; - - typedef std::vector MetaTxsList; + using txnMetaLedgerType = std::tuple; + using MetaTxsList = std::vector; virtual MetaTxsList getAccountTxsB (RippleAddress const& account, std::int32_t minLedger, std::int32_t maxLedger, bool descending, diff --git a/src/ripple/app/misc/OrderBook.h b/src/ripple/app/misc/OrderBook.h index 5347b721f7..d9fab39c0d 100644 --- a/src/ripple/app/misc/OrderBook.h +++ b/src/ripple/app/misc/OrderBook.h @@ -26,9 +26,9 @@ namespace ripple { class OrderBook { public: - typedef std::shared_ptr pointer; - typedef std::shared_ptr const& ref; - typedef std::vector List; + using pointer = std::shared_ptr ; + using ref = std::shared_ptr const&; + using List = std::vector; /** Construct from a currency specification. diff --git a/src/ripple/app/misc/UniqueNodeList.cpp b/src/ripple/app/misc/UniqueNodeList.cpp index bc68cbc928..e5d0eab76d 100644 --- a/src/ripple/app/misc/UniqueNodeList.cpp +++ b/src/ripple/app/misc/UniqueNodeList.cpp @@ -2165,12 +2165,12 @@ private: } } private: - typedef RippleMutex FetchLockType; - typedef std::lock_guard ScopedFetchLockType; + using FetchLockType = RippleMutex; + using ScopedFetchLockType = std::lock_guard ; FetchLockType mFetchLock; - typedef RippleRecursiveMutex UNLLockType; - typedef std::lock_guard ScopedUNLLockType; + using UNLLockType = RippleRecursiveMutex; + using ScopedUNLLockType = std::lock_guard ; UNLLockType mUNLLock; // VFALCO TODO Replace ptime with beast::Time diff --git a/src/ripple/app/misc/UniqueNodeList.h b/src/ripple/app/misc/UniqueNodeList.h index a73e684e7f..58303cf0a2 100644 --- a/src/ripple/app/misc/UniqueNodeList.h +++ b/src/ripple/app/misc/UniqueNodeList.h @@ -45,7 +45,7 @@ public: }; // VFALCO TODO rename this to use the right coding style - typedef long score; + using score = long; public: virtual ~UniqueNodeList () { } diff --git a/src/ripple/app/misc/Validations.cpp b/src/ripple/app/misc/Validations.cpp index c099e027c8..01c80c1e35 100644 --- a/src/ripple/app/misc/Validations.cpp +++ b/src/ripple/app/misc/Validations.cpp @@ -39,8 +39,8 @@ class ValidationsImp : public Validations { private: using LockType = std::mutex; - typedef std::lock_guard ScopedLockType; - typedef beast::GenericScopedUnlock ScopedUnlockType; + using ScopedLockType = std::lock_guard ; + using ScopedUnlockType = beast::GenericScopedUnlock ; std::mutex mutable mLock; TaggedCache mValidations; diff --git a/src/ripple/app/misc/Validations.h b/src/ripple/app/misc/Validations.h index a916531f8b..35fcbc33f1 100644 --- a/src/ripple/app/misc/Validations.h +++ b/src/ripple/app/misc/Validations.h @@ -26,14 +26,14 @@ namespace ripple { -// VFALCO TODO rename and move these typedefs into the Validations interface +// VFALCO TODO rename and move these type aliases into the Validations interface // nodes validating and highest node ID validating -typedef hash_map ValidationSet; +using ValidationSet = hash_map; -typedef std::pair ValidationCounter; -typedef hash_map LedgerToValidationCounter; -typedef std::vector ValidationVector; +using ValidationCounter = std::pair; +using LedgerToValidationCounter = hash_map; +using ValidationVector = std::vector; class Validations { @@ -61,7 +61,7 @@ public: virtual int getNodesAfter (uint256 const& ledger) = 0; virtual int getLoadRatio (bool overLoaded) = 0; - // VFALCO TODO make a typedef for this ugly return value! + // VFALCO TODO make a type alias for this ugly return value! virtual LedgerToValidationCounter getCurrentValidations ( uint256 currentLedger, uint256 previousLedger) = 0; diff --git a/src/ripple/app/paths/Node.h b/src/ripple/app/paths/Node.h index a4230e2f0f..9815e05724 100644 --- a/src/ripple/app/paths/Node.h +++ b/src/ripple/app/paths/Node.h @@ -29,7 +29,7 @@ namespace path { struct Node { - typedef std::vector List; + using List = std::vector; inline bool isAccount() const { diff --git a/src/ripple/app/paths/PathRequest.h b/src/ripple/app/paths/PathRequest.h index 5371c719e8..ac0c28731d 100644 --- a/src/ripple/app/paths/PathRequest.h +++ b/src/ripple/app/paths/PathRequest.h @@ -46,10 +46,10 @@ class PathRequest : public: static char const* getCountedObjectName () { return "PathRequest"; } - typedef std::weak_ptr wptr; - typedef std::shared_ptr pointer; - typedef const pointer& ref; - typedef const wptr& wref; + using wptr = std::weak_ptr; + using pointer = std::shared_ptr; + using ref = const pointer&; + using wref = const wptr&; public: // VFALCO TODO Break the cyclic dependency on InfoSub @@ -87,8 +87,8 @@ private: beast::Journal m_journal; - typedef RippleRecursiveMutex LockType; - typedef std::lock_guard ScopedLockType; + using LockType = RippleRecursiveMutex; + using ScopedLockType = std::lock_guard ; LockType mLock; PathRequests& mOwner; diff --git a/src/ripple/app/paths/PathRequests.h b/src/ripple/app/paths/PathRequests.h index 0d507284ba..70f74027fb 100644 --- a/src/ripple/app/paths/PathRequests.h +++ b/src/ripple/app/paths/PathRequests.h @@ -73,8 +73,8 @@ private: std::atomic mLastIdentifier; - typedef RippleRecursiveMutex LockType; - typedef std::lock_guard ScopedLockType; + using LockType = RippleRecursiveMutex; + using ScopedLockType = std::lock_guard ; LockType mLock; }; diff --git a/src/ripple/app/paths/PathState.h b/src/ripple/app/paths/PathState.h index 817e244882..d6f516d706 100644 --- a/src/ripple/app/paths/PathState.h +++ b/src/ripple/app/paths/PathState.h @@ -30,9 +30,9 @@ namespace ripple { class PathState : public CountedObject { public: - typedef std::vector OfferIndexList; - typedef std::shared_ptr Ptr; - typedef std::vector List; + using OfferIndexList = std::vector; + using Ptr = std::shared_ptr; + using List = std::vector; PathState (STAmount const& saSend, STAmount const& saSendMax) : mIndex (0) diff --git a/src/ripple/app/paths/Pathfinder.cpp b/src/ripple/app/paths/Pathfinder.cpp index c1fe0937a8..081e85832a 100644 --- a/src/ripple/app/paths/Pathfinder.cpp +++ b/src/ripple/app/paths/Pathfinder.cpp @@ -112,7 +112,7 @@ bool compareAccountCandidate ( return (first.priority ^ seq) < (second.priority ^ seq); } -typedef std::vector AccountCandidates; +using AccountCandidates = std::vector; struct CostedPath { @@ -120,15 +120,15 @@ struct CostedPath Pathfinder::PathType type; }; -typedef std::vector CostedPathList; +using CostedPathList = std::vector; -typedef std::map PathTable; +using PathTable = std::map; struct PathCost { int cost; char const* path; }; -typedef std::vector PathCostList; +using PathCostList = std::vector; static PathTable mPathTable; diff --git a/src/ripple/app/paths/RippleLineCache.h b/src/ripple/app/paths/RippleLineCache.h index 5e5f0ad190..4a8f6fe600 100644 --- a/src/ripple/app/paths/RippleLineCache.h +++ b/src/ripple/app/paths/RippleLineCache.h @@ -32,9 +32,9 @@ namespace ripple { class RippleLineCache { public: - typedef std::vector RippleStateVector; - typedef std::shared_ptr pointer; - typedef pointer const& ref; + using RippleStateVector = std::vector ; + using pointer = std::shared_ptr ; + using ref = pointer const&; explicit RippleLineCache (Ledger::ref l); @@ -47,8 +47,8 @@ public: getRippleLines (Account const& accountID); private: - typedef RippleMutex LockType; - typedef std::lock_guard ScopedLockType; + using LockType = RippleMutex; + using ScopedLockType = std::lock_guard ; LockType mLock; ripple::hardened_hash<> hasher_; diff --git a/src/ripple/app/paths/RippleState.h b/src/ripple/app/paths/RippleState.h index 5b531ebdfa..6044be2d63 100644 --- a/src/ripple/app/paths/RippleState.h +++ b/src/ripple/app/paths/RippleState.h @@ -35,7 +35,7 @@ namespace ripple { class RippleState { public: - typedef std::shared_ptr pointer; + using pointer = std::shared_ptr ; public: RippleState () = delete; diff --git a/src/ripple/app/paths/Types.h b/src/ripple/app/paths/Types.h index a1fa74907f..b3cdef32e6 100644 --- a/src/ripple/app/paths/Types.h +++ b/src/ripple/app/paths/Types.h @@ -23,18 +23,18 @@ namespace ripple { // account id, issue. -typedef std::pair AccountIssue; +using AccountIssue = std::pair ; // Map of account, issue to node index. namespace path { -typedef unsigned int NodeIndex; +using NodeIndex = unsigned int; -typedef hash_set OfferSet; +using OfferSet = hash_set ; } -typedef hash_map AccountIssueToNodeIndex; +using AccountIssueToNodeIndex = hash_map ; } // ripple diff --git a/src/ripple/app/tx/InboundTransactions.h b/src/ripple/app/tx/InboundTransactions.h index 82a6103a2a..db49afb596 100644 --- a/src/ripple/app/tx/InboundTransactions.h +++ b/src/ripple/app/tx/InboundTransactions.h @@ -34,7 +34,7 @@ namespace ripple { class InboundTransactions { public: - typedef beast::abstract_clock clock_type; + using clock_type = beast::abstract_clock ; InboundTransactions() = default; InboundTransactions(InboundTransactions const&) = delete; diff --git a/src/ripple/app/tx/Transaction.h b/src/ripple/app/tx/Transaction.h index d9cb46f2c4..ce2caef56c 100644 --- a/src/ripple/app/tx/Transaction.h +++ b/src/ripple/app/tx/Transaction.h @@ -58,8 +58,8 @@ class Transaction public: static char const* getCountedObjectName () { return "Transaction"; } - typedef std::shared_ptr pointer; - typedef const pointer& ref; + using pointer = std::shared_ptr; + using ref = const pointer&; public: Transaction (STTx::ref, Validate, std::string&) noexcept; diff --git a/src/ripple/app/tx/TransactionAcquire.h b/src/ripple/app/tx/TransactionAcquire.h index cb54e62620..1beca08700 100644 --- a/src/ripple/app/tx/TransactionAcquire.h +++ b/src/ripple/app/tx/TransactionAcquire.h @@ -35,7 +35,7 @@ class TransactionAcquire public: static char const* getCountedObjectName () { return "TransactionAcquire"; } - typedef std::shared_ptr pointer; + using pointer = std::shared_ptr; public: TransactionAcquire (uint256 const& hash, clock_type& clock); diff --git a/src/ripple/app/tx/TransactionMeta.h b/src/ripple/app/tx/TransactionMeta.h index e05034ead7..607de2f0bf 100644 --- a/src/ripple/app/tx/TransactionMeta.h +++ b/src/ripple/app/tx/TransactionMeta.h @@ -30,8 +30,8 @@ namespace ripple { class TransactionMetaSet { public: - typedef std::shared_ptr pointer; - typedef const pointer& ref; + using pointer = std::shared_ptr; + using ref = const pointer&; private: struct CtorHelper{}; diff --git a/src/ripple/app/tx/impl/InboundTransactions.cpp b/src/ripple/app/tx/impl/InboundTransactions.cpp index cdd5b70a67..c1938f2c42 100644 --- a/src/ripple/app/tx/impl/InboundTransactions.cpp +++ b/src/ripple/app/tx/impl/InboundTransactions.cpp @@ -63,7 +63,7 @@ class InboundTransactionsImp { public: - typedef std::pair u256_acq_pair; + using u256_acq_pair = std::pair; InboundTransactionsImp ( clock_type& clock, @@ -272,10 +272,10 @@ public: private: clock_type& m_clock; - typedef hash_map MapType; + using MapType = hash_map ; - typedef RippleRecursiveMutex LockType; - typedef std::unique_lock ScopedLockType; + using LockType = RippleRecursiveMutex; + using ScopedLockType = std::unique_lock ; LockType mLock; MapType m_map; diff --git a/src/ripple/basics/BasicTypes.h b/src/ripple/basics/BasicTypes.h index 8013ef7a5d..2ea8fa896c 100644 --- a/src/ripple/basics/BasicTypes.h +++ b/src/ripple/basics/BasicTypes.h @@ -25,8 +25,8 @@ namespace ripple { // VFALCO DEPRECATED -typedef std::mutex RippleMutex; -typedef std::recursive_mutex RippleRecursiveMutex; +using RippleMutex = std::mutex; +using RippleRecursiveMutex = std::recursive_mutex; } // ripple diff --git a/src/ripple/basics/Blob.h b/src/ripple/basics/Blob.h index 51e061b96e..068fc2d677 100644 --- a/src/ripple/basics/Blob.h +++ b/src/ripple/basics/Blob.h @@ -27,7 +27,7 @@ namespace ripple { /** Storage for linear binary data. Blocks of binary data appear often in various idioms and structures. */ -typedef std::vector Blob; +using Blob = std::vector ; } diff --git a/src/ripple/basics/CountedObject.h b/src/ripple/basics/CountedObject.h index 71f6b982ea..e2ada44583 100644 --- a/src/ripple/basics/CountedObject.h +++ b/src/ripple/basics/CountedObject.h @@ -35,8 +35,8 @@ class CountedObjects public: static CountedObjects& getInstance (); - typedef std::pair Entry; - typedef std::vector List; + using Entry = std::pair ; + using List = std::vector ; List getCounts (int minimumThreshold) const; diff --git a/src/ripple/basics/DecayingSample.h b/src/ripple/basics/DecayingSample.h index 37c0ef09e3..a55b7e0a65 100644 --- a/src/ripple/basics/DecayingSample.h +++ b/src/ripple/basics/DecayingSample.h @@ -32,8 +32,8 @@ template class DecayingSample { public: - typedef typename Clock::duration::rep value_type; - typedef typename Clock::time_point time_point; + using value_type = typename Clock::duration::rep; + using time_point = typename Clock::time_point; DecayingSample () = delete; diff --git a/src/ripple/basics/KeyCache.h b/src/ripple/basics/KeyCache.h index 0410aa110d..4aa454c9d4 100644 --- a/src/ripple/basics/KeyCache.h +++ b/src/ripple/basics/KeyCache.h @@ -46,8 +46,8 @@ template < class KeyCache { public: - typedef Key key_type; - typedef beast::abstract_clock clock_type; + using key_type = Key; + using clock_type = beast::abstract_clock ; private: struct Stats @@ -80,12 +80,12 @@ private: clock_type::time_point last_access; }; - typedef hardened_hash_map map_type; - typedef typename map_type::iterator iterator; - typedef std::lock_guard lock_guard; + using map_type = hardened_hash_map ; + using iterator = typename map_type::iterator; + using lock_guard = std::lock_guard ; public: - typedef typename map_type::size_type size_type; + using size_type = typename map_type::size_type; private: Mutex mutable m_mutex; diff --git a/src/ripple/basics/RangeSet.h b/src/ripple/basics/RangeSet.h index c66a945fe0..b20c558a0a 100644 --- a/src/ripple/basics/RangeSet.h +++ b/src/ripple/basics/RangeSet.h @@ -71,12 +71,12 @@ private: void simplify (); private: - typedef std::map Map; + using Map = std::map ; - typedef Map::const_iterator const_iterator; - typedef Map::const_reverse_iterator const_reverse_iterator; - typedef Map::value_type value_type; - typedef Map::iterator iterator; + using const_iterator = Map::const_iterator; + using const_reverse_iterator = Map::const_reverse_iterator; + using value_type = Map::value_type; + using iterator = Map::iterator; static bool contains (value_type const& it, std::uint32_t v) { diff --git a/src/ripple/basics/Resolver.h b/src/ripple/basics/Resolver.h index 01c818afc1..13194636b3 100644 --- a/src/ripple/basics/Resolver.h +++ b/src/ripple/basics/Resolver.h @@ -31,10 +31,8 @@ namespace ripple { class Resolver { public: - typedef std::function < - void (std::string, - std::vector ) > - HandlerType; + using HandlerType = std::function < + void (std::string, std::vector ) >; virtual ~Resolver () = 0; diff --git a/src/ripple/basics/TaggedCache.h b/src/ripple/basics/TaggedCache.h index 9974c12272..45339b401a 100644 --- a/src/ripple/basics/TaggedCache.h +++ b/src/ripple/basics/TaggedCache.h @@ -58,16 +58,16 @@ template < class TaggedCache { public: - typedef Mutex mutex_type; + using mutex_type = Mutex; // VFALCO DEPRECATED The caller can just use std::unique_lock - typedef std::unique_lock ScopedLockType; - typedef std::lock_guard lock_guard; - typedef Key key_type; - typedef T mapped_type; + using ScopedLockType = std::unique_lock ; + using lock_guard = std::lock_guard ; + using key_type = Key; + using mapped_type = T; // VFALCO TODO Use std::shared_ptr, std::weak_ptr - typedef std::weak_ptr weak_mapped_ptr; - typedef std::shared_ptr mapped_ptr; - typedef beast::abstract_clock clock_type; + using weak_mapped_ptr = std::weak_ptr ; + using mapped_ptr = std::shared_ptr ; + using clock_type = beast::abstract_clock ; public: // VFALCO TODO Change expiration_seconds to clock_type::duration @@ -542,8 +542,8 @@ private: void touch (clock_type::time_point const& now) { last_access = now; } }; - typedef hardened_hash_map cache_type; - typedef typename cache_type::iterator cache_iterator; + using cache_type = hardened_hash_map ; + using cache_iterator = typename cache_type::iterator; beast::Journal m_journal; clock_type& m_clock; diff --git a/src/ripple/basics/base_uint.h b/src/ripple/basics/base_uint.h index 156e231125..ad750baf73 100644 --- a/src/ripple/basics/base_uint.h +++ b/src/ripple/basics/base_uint.h @@ -68,21 +68,18 @@ public: static std::size_t const bytes = Bits / 8; - typedef std::size_t size_type; - typedef std::ptrdiff_t difference_type; - typedef unsigned char value_type; - typedef value_type* pointer; - typedef value_type& reference; - typedef value_type const* const_pointer; - typedef value_type const& const_reference; - typedef pointer iterator; - typedef const_pointer const_iterator; - typedef std::reverse_iterator - reverse_iterator; - typedef std::reverse_iterator - const_reverse_iterator; - - typedef Tag tag_type; + using size_type = std::size_t; + using difference_type = std::ptrdiff_t; + using value_type = unsigned char; + using pointer = value_type*; + using reference = value_type&; + using const_pointer = value_type const*; + using const_reference = value_type const&; + using iterator = pointer; + using const_iterator = const_pointer; + using reverse_iterator = std::reverse_iterator; + using const_reverse_iterator = std::reverse_iterator; + using tag_type = Tag; pointer data() { return reinterpret_cast(pn); } const_pointer data() const { return reinterpret_cast(pn); } @@ -97,7 +94,7 @@ public: /** Value hashing function. The seed prevents crafted inputs from causing degenarate parent containers. */ - typedef hardened_hash <> hasher; + using hasher = hardened_hash <>; /** Container equality testing function. */ class key_equal @@ -405,8 +402,8 @@ public: }; using uint128 = base_uint<128>; -using uint160 = base_uint<160> ; -using uint256 = base_uint<256> ; +using uint160 = base_uint<160>; +using uint256 = base_uint<256>; template inline int compare ( diff --git a/src/ripple/basics/impl/CheckLibraryVersions.cpp b/src/ripple/basics/impl/CheckLibraryVersions.cpp index 7a999905d7..d7e92627d2 100644 --- a/src/ripple/basics/impl/CheckLibraryVersions.cpp +++ b/src/ripple/basics/impl/CheckLibraryVersions.cpp @@ -29,7 +29,7 @@ namespace ripple { namespace version { -typedef unsigned long long VersionNumber; +using VersionNumber = unsigned long long; const char boostMinimal[] = "1.55.0"; const char openSSLMinimal[] = "1.0.1-g"; diff --git a/src/ripple/basics/impl/CheckLibraryVersionsImpl.h b/src/ripple/basics/impl/CheckLibraryVersionsImpl.h index e0f63797b9..f106ccf288 100644 --- a/src/ripple/basics/impl/CheckLibraryVersionsImpl.h +++ b/src/ripple/basics/impl/CheckLibraryVersionsImpl.h @@ -28,7 +28,7 @@ namespace ripple { namespace version { /** Both Boost and OpenSSL have integral version numbers. */ -typedef unsigned long long VersionNumber; +using VersionNumber = unsigned long long; /** Minimal required boost version. */ extern const char boostMinimal[]; diff --git a/src/ripple/basics/impl/ResolverAsio.cpp b/src/ripple/basics/impl/ResolverAsio.cpp index 48ae2828b6..e4ee440409 100644 --- a/src/ripple/basics/impl/ResolverAsio.cpp +++ b/src/ripple/basics/impl/ResolverAsio.cpp @@ -36,7 +36,7 @@ class ResolverAsioImpl , public beast::asio::AsyncObject { public: - typedef std::pair HostAndPort; + using HostAndPort = std::pair ; beast::Journal m_journal; diff --git a/src/ripple/basics/impl/make_SSLContext.cpp b/src/ripple/basics/impl/make_SSLContext.cpp index 1488ed2dee..5106517e19 100644 --- a/src/ripple/basics/impl/make_SSLContext.cpp +++ b/src/ripple/basics/impl/make_SSLContext.cpp @@ -75,7 +75,7 @@ using custom_delete_unique_ptr = std::unique_ptr >; // RSA -typedef custom_delete_unique_ptr rsa_ptr; +using rsa_ptr = custom_delete_unique_ptr ; static rsa_ptr rsa_generate_key (int n_bits) { @@ -91,7 +91,7 @@ static rsa_ptr rsa_generate_key (int n_bits) // EVP_PKEY -typedef custom_delete_unique_ptr evp_pkey_ptr; +using evp_pkey_ptr = custom_delete_unique_ptr ; static evp_pkey_ptr evp_pkey_new() { @@ -117,7 +117,7 @@ static void evp_pkey_assign_rsa (EVP_PKEY* evp_pkey, rsa_ptr&& rsa) // X509 -typedef custom_delete_unique_ptr x509_ptr; +using x509_ptr = custom_delete_unique_ptr ; static x509_ptr x509_new() { diff --git a/src/ripple/basics/tests/KeyCache.test.cpp b/src/ripple/basics/tests/KeyCache.test.cpp index e09444f3c1..27e23ec92c 100644 --- a/src/ripple/basics/tests/KeyCache.test.cpp +++ b/src/ripple/basics/tests/KeyCache.test.cpp @@ -32,8 +32,8 @@ public: beast::manual_clock clock; clock.set (0); - typedef std::string Key; - typedef KeyCache Cache; + using Key = std::string; + using Cache = KeyCache ; // Insert an item, retrieve it, and age it so it gets purged. { diff --git a/src/ripple/basics/tests/TaggedCache.test.cpp b/src/ripple/basics/tests/TaggedCache.test.cpp index cbda78d421..e911c8dd47 100644 --- a/src/ripple/basics/tests/TaggedCache.test.cpp +++ b/src/ripple/basics/tests/TaggedCache.test.cpp @@ -44,9 +44,9 @@ public: beast::manual_clock clock; clock.set (0); - typedef int Key; - typedef std::string Value; - typedef TaggedCache Cache; + using Key = int; + using Value = std::string; + using Cache = TaggedCache ; Cache c ("test", 1, 1, clock, j); diff --git a/src/ripple/basics/tests/hardened_hash_test.cpp b/src/ripple/basics/tests/hardened_hash_test.cpp index 7775fa10a2..01cc3c90aa 100644 --- a/src/ripple/basics/tests/hardened_hash_test.cpp +++ b/src/ripple/basics/tests/hardened_hash_test.cpp @@ -118,7 +118,7 @@ private: std::array m_vec; public: - typedef UInt value_type; + using value_type = UInt; static std::size_t const bits = Bits; static std::size_t const bytes = bits / 8; @@ -169,7 +169,7 @@ public: } }; -typedef unsigned_integer <256, std::size_t> sha256_t; +using sha256_t = unsigned_integer <256, std::size_t>; static_assert (sha256_t::bits == 256, "sha256_t must have 256 bits"); diff --git a/src/ripple/core/Job.h b/src/ripple/core/Job.h index 9ebb4998e9..8bdb682b50 100644 --- a/src/ripple/core/Job.h +++ b/src/ripple/core/Job.h @@ -81,7 +81,7 @@ enum JobType class Job { public: - typedef std::chrono::steady_clock clock_type; + using clock_type = std::chrono::steady_clock; /** Default constructor. @@ -101,7 +101,7 @@ public: Job (JobType type, std::uint64_t index); /** A callback used to check for canceling a job. */ - typedef std::function CancelCallback; + using CancelCallback = std::function ; // VFALCO TODO try to remove the dependency on LoadMonitor. Job (JobType type, diff --git a/src/ripple/core/JobTypes.h b/src/ripple/core/JobTypes.h index 174e7a0c87..901bef72e0 100644 --- a/src/ripple/core/JobTypes.h +++ b/src/ripple/core/JobTypes.h @@ -30,8 +30,8 @@ namespace ripple class JobTypes { public: - typedef std::map Map; - typedef Map::const_iterator const_iterator; + using Map = std::map ; + using const_iterator = Map::const_iterator; JobTypes () : m_unknown (jtINVALID, "invalid", 0, true, true, 0, 0) diff --git a/src/ripple/core/LoadEvent.h b/src/ripple/core/LoadEvent.h index 773718bce8..f2c859678f 100644 --- a/src/ripple/core/LoadEvent.h +++ b/src/ripple/core/LoadEvent.h @@ -41,8 +41,8 @@ public: // // Why both kinds of containers? // - typedef std::shared_ptr pointer; - typedef std::unique_ptr autoptr; + using pointer = std::shared_ptr ; + using autoptr = std::unique_ptr ; public: // VFALCO TODO remove the dependency on LoadMonitor. Is that possible? diff --git a/src/ripple/core/LoadMonitor.h b/src/ripple/core/LoadMonitor.h index 246e3f9a78..4da2d4bfca 100644 --- a/src/ripple/core/LoadMonitor.h +++ b/src/ripple/core/LoadMonitor.h @@ -67,8 +67,8 @@ private: void update (); - typedef std::mutex LockType; - typedef std::lock_guard ScopedLockType; + using LockType = std::mutex; + using ScopedLockType = std::lock_guard ; LockType mLock; std::uint64_t mCounts; diff --git a/src/ripple/core/impl/JobQueue.cpp b/src/ripple/core/impl/JobQueue.cpp index 0343bd02d3..7b9d6b135d 100644 --- a/src/ripple/core/impl/JobQueue.cpp +++ b/src/ripple/core/impl/JobQueue.cpp @@ -37,9 +37,9 @@ class JobQueueImp , private beast::Workers::Callback { public: - typedef std::set JobSet; - typedef std::map JobDataMap; - typedef std::lock_guard ScopedLock; + using JobSet = std::set ; + using JobDataMap = std::map ; + using ScopedLock = std::lock_guard ; beast::Journal m_journal; std::mutex m_mutex; @@ -615,7 +615,7 @@ private: ScopedLock lock (m_mutex); // Remove all jobs whose type is skipOnStop - typedef hash_map JobDataMap; + using JobDataMap = hash_map ; JobDataMap counts; bool const report (m_journal.debug.active()); diff --git a/src/ripple/core/impl/LoadFeeTrackImp.h b/src/ripple/core/impl/LoadFeeTrackImp.h index f33ac14870..e73730e3fa 100644 --- a/src/ripple/core/impl/LoadFeeTrackImp.h +++ b/src/ripple/core/impl/LoadFeeTrackImp.h @@ -223,8 +223,8 @@ private: static const int lftFeeMax = lftNormalFee * 1000000; beast::Journal m_journal; - typedef std::mutex LockType; - typedef std::lock_guard ScopedLockType; + using LockType = std::mutex; + using ScopedLockType = std::lock_guard ; LockType mLock; std::uint32_t mLocalTxnLoadFee; // Scale factor, lftNormalFee = normal fee diff --git a/src/ripple/crypto/Base58.h b/src/ripple/crypto/Base58.h index 7b8ff4e7bc..fb5640bc83 100644 --- a/src/ripple/crypto/Base58.h +++ b/src/ripple/crypto/Base58.h @@ -96,7 +96,7 @@ public: static std::string encode (InputIt first, InputIt last, Alphabet const& alphabet, bool withCheck) { - typedef typename std::iterator_traits::value_type value_type; + using value_type = typename std::iterator_traits::value_type; std::vector ::type> v; std::size_t const size (std::distance (first, last)); if (withCheck) diff --git a/src/ripple/crypto/impl/ec_key.h b/src/ripple/crypto/impl/ec_key.h index 2698d4ed62..9c2aaba96b 100644 --- a/src/ripple/crypto/impl/ec_key.h +++ b/src/ripple/crypto/impl/ec_key.h @@ -29,7 +29,7 @@ namespace openssl { class ec_key { public: - typedef struct opaque_EC_KEY* pointer_t; + using pointer_t = struct opaque_EC_KEY*; private: pointer_t ptr; diff --git a/src/ripple/crypto/impl/openssl.h b/src/ripple/crypto/impl/openssl.h index f79bd0d2e7..94d1170df8 100644 --- a/src/ripple/crypto/impl/openssl.h +++ b/src/ripple/crypto/impl/openssl.h @@ -148,7 +148,7 @@ inline void add_to (bignum const& a, class ec_point { public: - typedef EC_POINT* pointer_t; + using pointer_t = EC_POINT*; private: pointer_t ptr; diff --git a/src/ripple/json/impl/json_batchallocator.h b/src/ripple/json/impl/json_batchallocator.h index 517e592126..8d8b6c1cb4 100644 --- a/src/ripple/json/impl/json_batchallocator.h +++ b/src/ripple/json/impl/json_batchallocator.h @@ -40,7 +40,7 @@ template < typename AllocatedType class BatchAllocator { public: - typedef AllocatedType Type; + using Type = AllocatedType; BatchAllocator ( unsigned int objectsPerPage = 255 ) : freeHead_ ( 0 ) diff --git a/src/ripple/json/json_forwards.h b/src/ripple/json/json_forwards.h index 639022ab3e..6e8014ad8f 100644 --- a/src/ripple/json/json_forwards.h +++ b/src/ripple/json/json_forwards.h @@ -24,8 +24,8 @@ namespace Json { // value.h -typedef int Int; -typedef unsigned int UInt; +using Int = int; +using UInt = unsigned int; class StaticString; class Value; class ValueIteratorBase; diff --git a/src/ripple/json/json_reader.h b/src/ripple/json/json_reader.h index db3aab394f..42d107af16 100644 --- a/src/ripple/json/json_reader.h +++ b/src/ripple/json/json_reader.h @@ -36,8 +36,8 @@ namespace Json class Reader { public: - typedef char Char; - typedef const Char* Location; + using Char = char; + using Location = const Char*; /** \brief Constructs a Reader allowing all features * for parsing. @@ -107,7 +107,7 @@ private: Location extra_; }; - typedef std::deque Errors; + using Errors = std::deque; bool expectToken ( TokenType type, Token& token, const char* message ); bool readToken ( Token& token ); @@ -150,7 +150,7 @@ private: std::string getLocationLineAndColumn ( Location location ) const; void skipCommentTokens ( Token& token ); - typedef std::stack Nodes; + using Nodes = std::stack; Nodes nodes_; Errors errors_; std::string document_; diff --git a/src/ripple/json/json_value.h b/src/ripple/json/json_value.h index 0e460b8dcb..3d23f679dd 100644 --- a/src/ripple/json/json_value.h +++ b/src/ripple/json/json_value.h @@ -141,12 +141,12 @@ class Value friend class ValueIteratorBase; public: - typedef std::vector Members; - typedef ValueIterator iterator; - typedef ValueConstIterator const_iterator; - typedef Json::UInt UInt; - typedef Json::Int Int; - typedef UInt ArrayIndex; + using Members = std::vector; + using iterator = ValueIterator; + using const_iterator = ValueConstIterator; + using UInt = Json::UInt; + using Int = Json::Int; + using ArrayIndex = UInt; static const Value null; static const Int minInt; @@ -180,7 +180,7 @@ private: }; public: - typedef std::map ObjectValues; + using ObjectValues = std::map; public: /** \brief Create a default Value of the given type. @@ -414,9 +414,9 @@ public: class ValueIteratorBase { public: - typedef unsigned int size_t; - typedef int difference_type; - typedef ValueIteratorBase SelfType; + using size_t = unsigned int; + using difference_type = int; + using SelfType = ValueIteratorBase; ValueIteratorBase (); @@ -472,11 +472,11 @@ class ValueConstIterator : public ValueIteratorBase { friend class Value; public: - typedef unsigned int size_t; - typedef int difference_type; - typedef const Value& reference; - typedef const Value* pointer; - typedef ValueConstIterator SelfType; + using size_t = unsigned int; + using difference_type = int; + using reference = const Value&; + using pointer = const Value*; + using SelfType = ValueConstIterator; ValueConstIterator (); private: @@ -525,11 +525,11 @@ class ValueIterator : public ValueIteratorBase { friend class Value; public: - typedef unsigned int size_t; - typedef int difference_type; - typedef Value& reference; - typedef Value* pointer; - typedef ValueIterator SelfType; + using size_t = unsigned int; + using difference_type = int; + using reference = Value&; + using pointer = Value*; + using SelfType = ValueIterator; ValueIterator (); ValueIterator ( const ValueConstIterator& other ); diff --git a/src/ripple/json/json_writer.h b/src/ripple/json/json_writer.h index 75ccb3e0f7..e4392c4673 100644 --- a/src/ripple/json/json_writer.h +++ b/src/ripple/json/json_writer.h @@ -101,7 +101,7 @@ private: void indent (); void unindent (); - typedef std::vector ChildValues; + using ChildValues = std::vector; ChildValues childValues_; std::string document_; @@ -155,7 +155,7 @@ private: void indent (); void unindent (); - typedef std::vector ChildValues; + using ChildValues = std::vector; ChildValues childValues_; std::ostream* document_; diff --git a/src/ripple/net/InfoSub.h b/src/ripple/net/InfoSub.h index f9493988fc..683d9a7d43 100644 --- a/src/ripple/net/InfoSub.h +++ b/src/ripple/net/InfoSub.h @@ -43,14 +43,14 @@ class InfoSub public: static char const* getCountedObjectName () { return "InfoSub"; } - typedef std::shared_ptr pointer; + using pointer = std::shared_ptr; - // VFALCO TODO Standardize on the names of weak / strong pointer typedefs. - typedef std::weak_ptr wptr; + // VFALCO TODO Standardize on the names of weak / strong pointer type aliases. + using wptr = std::weak_ptr; - typedef const std::shared_ptr& ref; + using ref = const std::shared_ptr&; - typedef Resource::Consumer Consumer; + using Consumer = Resource::Consumer; public: /** Abstracts the source of subscription data. @@ -138,8 +138,8 @@ public: std::shared_ptr const& getPathRequest (); protected: - typedef std::mutex LockType; - typedef std::lock_guard ScopedLockType; + using LockType = std::mutex; + using ScopedLockType = std::lock_guard ; LockType mLock; private: diff --git a/src/ripple/net/RPCSub.h b/src/ripple/net/RPCSub.h index f42e9336dd..b2102bd285 100644 --- a/src/ripple/net/RPCSub.h +++ b/src/ripple/net/RPCSub.h @@ -31,8 +31,8 @@ namespace ripple { class RPCSub : public InfoSub { public: - typedef std::shared_ptr pointer; - typedef pointer const& ref; + using pointer = std::shared_ptr ; + using ref = pointer const&; // VFALCO Why is the io_service needed? static pointer New (InfoSub::Source& source, diff --git a/src/ripple/net/impl/HTTPClient.cpp b/src/ripple/net/impl/HTTPClient.cpp index 64d00c06c5..d33c0e9aff 100644 --- a/src/ripple/net/impl/HTTPClient.cpp +++ b/src/ripple/net/impl/HTTPClient.cpp @@ -490,7 +490,7 @@ public: } private: - typedef std::shared_ptr pointer; + using pointer = std::shared_ptr; bool mSSL; AutoSocket mSocket; diff --git a/src/ripple/net/impl/RPCCall.cpp b/src/ripple/net/impl/RPCCall.cpp index fbc14e001f..c1a1cc19ce 100644 --- a/src/ripple/net/impl/RPCCall.cpp +++ b/src/ripple/net/impl/RPCCall.cpp @@ -129,7 +129,7 @@ private: } private: - typedef Json::Value (RPCParser::*parseFuncPtr) (Json::Value const& jvParams); + using parseFuncPtr = Json::Value (RPCParser::*) (Json::Value const& jvParams); Json::Value parseAsIs (Json::Value const& jvParams) { diff --git a/src/ripple/nodestore/NodeObject.h b/src/ripple/nodestore/NodeObject.h index e4135966b5..fdcf915f0f 100644 --- a/src/ripple/nodestore/NodeObject.h +++ b/src/ripple/nodestore/NodeObject.h @@ -63,11 +63,11 @@ public: }; // Please use this one. For a reference use Ptr const& - typedef std::shared_ptr Ptr; + using Ptr = std::shared_ptr ; // These are DEPRECATED, type names are capitalized. - typedef std::shared_ptr pointer; - typedef pointer const& ref; + using pointer = std::shared_ptr ; + using ref = pointer const&; private: // This hack is used to make the constructor effectively private diff --git a/src/ripple/nodestore/Types.h b/src/ripple/nodestore/Types.h index 1b9fa68187..e38d6f88ff 100644 --- a/src/ripple/nodestore/Types.h +++ b/src/ripple/nodestore/Types.h @@ -47,7 +47,7 @@ enum Status }; /** A batch of NodeObjects to write at once. */ -typedef std::vector Batch; +using Batch = std::vector ; } } diff --git a/src/ripple/nodestore/impl/BatchWriter.h b/src/ripple/nodestore/impl/BatchWriter.h index b7676f2c3b..621cb762d9 100644 --- a/src/ripple/nodestore/impl/BatchWriter.h +++ b/src/ripple/nodestore/impl/BatchWriter.h @@ -71,8 +71,8 @@ private: void waitForWriting (); private: - typedef std::recursive_mutex LockType; - typedef std::condition_variable_any CondvarType; + using LockType = std::recursive_mutex; + using CondvarType = std::condition_variable_any; Callback& m_callback; Scheduler& m_scheduler; diff --git a/src/ripple/overlay/Message.h b/src/ripple/overlay/Message.h index f3cc5487ca..bf1550848c 100644 --- a/src/ripple/overlay/Message.h +++ b/src/ripple/overlay/Message.h @@ -32,7 +32,7 @@ namespace ripple { // VFALCO NOTE If we forward declare Message and write out shared_ptr -// instead of using the in-class typedef, we can remove the entire +// instead of using the in-class type alias, we can remove the entire // ripple.pb.h from the main headers. // @@ -47,7 +47,7 @@ namespace ripple { class Message : public std::enable_shared_from_this { public: - typedef std::shared_ptr pointer; + using pointer = std::shared_ptr; public: /** Number of bytes in a message header. diff --git a/src/ripple/overlay/Overlay.h b/src/ripple/overlay/Overlay.h index 21a71ff516..544ef4580e 100644 --- a/src/ripple/overlay/Overlay.h +++ b/src/ripple/overlay/Overlay.h @@ -70,7 +70,7 @@ public: bool expire = false; }; - typedef std::vector PeerSequence; + using PeerSequence = std::vector ; virtual ~Overlay() = default; @@ -160,8 +160,8 @@ public: The functor must: - Be callable as: void operator()(Peer::ptr const& peer); - - Must have the following typedef: - typedef void return_type; + - Must have the following type alias: + using return_type = void; - Be callable as: Function::return_type operator()() const; @@ -187,8 +187,8 @@ public: The visitor functor must: - Be callable as: void operator()(Peer::ptr const& peer); - - Must have the following typedef: - typedef void return_type; + - Must have the following type alias: + using return_type = void; @param f the functor to call with every peer */ diff --git a/src/ripple/overlay/PeerSet.h b/src/ripple/overlay/PeerSet.h index 237dc4ef26..80ee0245bc 100644 --- a/src/ripple/overlay/PeerSet.h +++ b/src/ripple/overlay/PeerSet.h @@ -47,7 +47,7 @@ namespace ripple { class PeerSet { public: - typedef beast::abstract_clock clock_type; + using clock_type = beast::abstract_clock ; /** Returns the hash of the data we want. */ uint256 const& getHash () const @@ -109,8 +109,8 @@ private: protected: // VFALCO TODO try to make some of these private - typedef RippleRecursiveMutex LockType; - typedef std::unique_lock ScopedLockType; + using LockType = RippleRecursiveMutex; + using ScopedLockType = std::unique_lock ; PeerSet (uint256 const& hash, int interval, bool txnData, clock_type& clock, beast::Journal journal); @@ -167,9 +167,9 @@ protected: boost::asio::deadline_timer mTimer; // VFALCO TODO Verify that these are used in the way that the names suggest. - typedef Peer::id_t PeerIdentifier; - typedef int ReceivedChunkCount; - typedef hash_map PeerSetMap; + using PeerIdentifier = Peer::id_t; + using ReceivedChunkCount = int; + using PeerSetMap = hash_map ; PeerSetMap mPeers; }; diff --git a/src/ripple/overlay/impl/OverlayImpl.cpp b/src/ripple/overlay/impl/OverlayImpl.cpp index 37d7b555e5..eb3d25d55b 100644 --- a/src/ripple/overlay/impl/OverlayImpl.cpp +++ b/src/ripple/overlay/impl/OverlayImpl.cpp @@ -39,7 +39,7 @@ namespace ripple { /** A functor to visit all active peers and retrieve their JSON data */ struct get_peer_json { - typedef Json::Value return_type; + using return_type = Json::Value; Json::Value json; diff --git a/src/ripple/overlay/impl/PeerImp.h b/src/ripple/overlay/impl/PeerImp.h index 85ca2040fa..bcd60f2464 100644 --- a/src/ripple/overlay/impl/PeerImp.h +++ b/src/ripple/overlay/impl/PeerImp.h @@ -87,14 +87,14 @@ public: ,sane }; - typedef std::shared_ptr ptr; + using ptr = std::shared_ptr ; private: - using clock_type = std::chrono::steady_clock; - using error_code= boost::system::error_code ; - using socket_type = boost::asio::ip::tcp::socket; - using stream_type = boost::asio::ssl::stream ; - using address_type = boost::asio::ip::address; + using clock_type = std::chrono::steady_clock; + using error_code = boost::system::error_code; + using socket_type = boost::asio::ip::tcp::socket; + using stream_type = boost::asio::ssl::stream ; + using address_type = boost::asio::ip::address; using endpoint_type = boost::asio::ip::tcp::endpoint; // The length of the smallest valid finished message diff --git a/src/ripple/overlay/predicates.h b/src/ripple/overlay/predicates.h index 7a8e3bb600..62da4f0fdb 100644 --- a/src/ripple/overlay/predicates.h +++ b/src/ripple/overlay/predicates.h @@ -30,7 +30,7 @@ namespace ripple { /** Sends a message to all peers */ struct send_always { - typedef void return_type; + using return_type = void; Message::pointer const& msg; @@ -50,7 +50,7 @@ struct send_always template struct send_if_pred { - typedef void return_type; + using return_type = void; Message::pointer const& msg; Predicate const& predicate; @@ -81,7 +81,7 @@ send_if_pred send_if ( template struct send_if_not_pred { - typedef void return_type; + using return_type = void; Message::pointer const& msg; Predicate const& predicate; diff --git a/src/ripple/peerfinder/Manager.h b/src/ripple/peerfinder/Manager.h index b6d38a64c1..df72df8f6a 100644 --- a/src/ripple/peerfinder/Manager.h +++ b/src/ripple/peerfinder/Manager.h @@ -30,10 +30,10 @@ namespace ripple { namespace PeerFinder { -typedef beast::abstract_clock clock_type; +using clock_type = beast::abstract_clock ; /** Represents a set of addresses. */ -typedef std::vector IPAddresses; +using IPAddresses = std::vector ; //------------------------------------------------------------------------------ @@ -104,7 +104,7 @@ struct Endpoint bool operator< (Endpoint const& lhs, Endpoint const& rhs); /** A set of Endpoint used for connecting. */ -typedef std::vector Endpoints; +using Endpoints = std::vector ; //------------------------------------------------------------------------------ diff --git a/src/ripple/peerfinder/Slot.h b/src/ripple/peerfinder/Slot.h index bd3bb590d6..7c9c2a8740 100644 --- a/src/ripple/peerfinder/Slot.h +++ b/src/ripple/peerfinder/Slot.h @@ -32,7 +32,7 @@ namespace PeerFinder { class Slot { public: - typedef std::shared_ptr ptr; + using ptr = std::shared_ptr ; enum State { diff --git a/src/ripple/peerfinder/impl/Bootcache.h b/src/ripple/peerfinder/impl/Bootcache.h index 3158386277..6cc0c41983 100644 --- a/src/ripple/peerfinder/impl/Bootcache.h +++ b/src/ripple/peerfinder/impl/Bootcache.h @@ -79,10 +79,10 @@ private: int m_valence; }; - typedef boost::bimaps::unordered_set_of left_t; - typedef boost::bimaps::multiset_of right_t; - typedef boost::bimap map_type; - typedef map_type::value_type value_type; + using left_t = boost::bimaps::unordered_set_of ; + using right_t = boost::bimaps::multiset_of ; + using map_type = boost::bimap ; + using value_type = map_type::value_type; struct Transform : std::unary_function < map_type::right_map::const_iterator::value_type const&, @@ -110,10 +110,10 @@ private: bool m_needsUpdate; public: - typedef boost::transform_iterator iterator; + using iterator = boost::transform_iterator ; - typedef iterator const_iterator; + using const_iterator = iterator; Bootcache ( Store& store, diff --git a/src/ripple/peerfinder/impl/Handouts.h b/src/ripple/peerfinder/impl/Handouts.h index 4c1a7dadbf..db0eb3d6cd 100644 --- a/src/ripple/peerfinder/impl/Handouts.h +++ b/src/ripple/peerfinder/impl/Handouts.h @@ -269,9 +269,9 @@ class ConnectHandouts public: // Keeps track of addresses we have made outgoing connections // to, for the purposes of not connecting to them too frequently. - typedef beast::aged_set Squelches; + using Squelches = beast::aged_set ; - typedef std::vector list_type; + using list_type = std::vector ; private: std::size_t m_needed; diff --git a/src/ripple/peerfinder/impl/Livecache.h b/src/ripple/peerfinder/impl/Livecache.h index d5d92d8339..f8caab5f19 100644 --- a/src/ripple/peerfinder/impl/Livecache.h +++ b/src/ripple/peerfinder/impl/Livecache.h @@ -51,9 +51,9 @@ protected: Endpoint endpoint; }; - typedef boost::intrusive::make_list - >::type list_type; + >::type; public: /** A list of Endpoint at the same hops @@ -75,15 +75,15 @@ public: }; public: - typedef boost::transform_iterator iterator; + using iterator = boost::transform_iterator ; - typedef iterator const_iterator; + using const_iterator = iterator; - typedef boost::transform_iterator reverse_iterator; + using reverse_iterator = boost::transform_iterator ; - typedef reverse_iterator const_reverse_iterator; + using const_reverse_iterator = reverse_iterator; iterator begin () const { @@ -184,15 +184,15 @@ template > class Livecache : protected detail::LivecacheBase { private: - typedef beast::aged_map , - Allocator> cache_type; + Allocator>; beast::Journal m_journal; cache_type m_cache; public: - typedef Allocator allocator_type; + using allocator_type = Allocator; /** Create the cache. */ Livecache ( @@ -215,8 +215,8 @@ public: // but not given out (since they would exceed maxHops). They // are used for automatic connection attempts. // - typedef std::array Histogram; - typedef std::array lists_type; + using Histogram = std::array ; + using lists_type = std::array ; template struct Transform @@ -231,17 +231,17 @@ public: }; public: - typedef boost::transform_iterator , - typename lists_type::iterator> iterator; + using iterator = boost::transform_iterator , + typename lists_type::iterator>; - typedef boost::transform_iterator , - typename lists_type::const_iterator> const_iterator; + using const_iterator = boost::transform_iterator , + typename lists_type::const_iterator>; - typedef boost::transform_iterator , - typename lists_type::reverse_iterator> reverse_iterator; + using reverse_iterator = boost::transform_iterator , + typename lists_type::reverse_iterator>; - typedef boost::transform_iterator , - typename lists_type::const_reverse_iterator> const_reverse_iterator; + using const_reverse_iterator = boost::transform_iterator , + typename lists_type::const_reverse_iterator>; iterator begin () { diff --git a/src/ripple/peerfinder/impl/Logic.h b/src/ripple/peerfinder/impl/Logic.h index e3eac66203..9538aca417 100644 --- a/src/ripple/peerfinder/impl/Logic.h +++ b/src/ripple/peerfinder/impl/Logic.h @@ -52,17 +52,17 @@ public: // Maps remote endpoints to slots. Since a slot has a // remote endpoint upon construction, this holds all counts. // - typedef std::map > Slots; + using Slots = std::map >; - typedef std::map FixedSlots; + using FixedSlots = std::map ; // A set of unique Ripple public keys - typedef std::set Keys; + using Keys = std::set ; // A set of non-unique IPAddresses without ports, used // to filter duplicates when making outgoing connections. - typedef std::multiset ConnectedAddresses; + using ConnectedAddresses = std::multiset ; struct State { @@ -113,7 +113,7 @@ public: Keys keys; }; - typedef beast::SharedData SharedState; + using SharedState = beast::SharedData ; beast::Journal m_journal; SharedState m_state; diff --git a/src/ripple/peerfinder/impl/SlotImp.h b/src/ripple/peerfinder/impl/SlotImp.h index b10bde4745..5f85e99e73 100644 --- a/src/ripple/peerfinder/impl/SlotImp.h +++ b/src/ripple/peerfinder/impl/SlotImp.h @@ -34,10 +34,10 @@ namespace PeerFinder { class SlotImp : public Slot { private: - typedef beast::aged_unordered_map recent_type; + using recent_type = beast::aged_unordered_map ; public: - typedef std::shared_ptr ptr; + using ptr = std::shared_ptr ; // inbound SlotImp (beast::IP::Endpoint const& local_endpoint, diff --git a/src/ripple/peerfinder/impl/SourceStrings.h b/src/ripple/peerfinder/impl/SourceStrings.h index 98aa521d11..520b676258 100644 --- a/src/ripple/peerfinder/impl/SourceStrings.h +++ b/src/ripple/peerfinder/impl/SourceStrings.h @@ -30,7 +30,7 @@ namespace PeerFinder { class SourceStrings : public Source { public: - typedef std::vector Strings; + using Strings = std::vector ; static beast::SharedPtr New (std::string const& name, Strings const& strings); }; diff --git a/src/ripple/peerfinder/impl/Store.h b/src/ripple/peerfinder/impl/Store.h index 1727a7c576..7e95395134 100644 --- a/src/ripple/peerfinder/impl/Store.h +++ b/src/ripple/peerfinder/impl/Store.h @@ -30,7 +30,7 @@ public: virtual ~Store () { } // load the bootstrap cache - typedef std::function load_callback; + using load_callback = std::function ; virtual std::size_t load (load_callback const& cb) = 0; // save the bootstrap cache diff --git a/src/ripple/peerfinder/impl/iosformat.h b/src/ripple/peerfinder/impl/iosformat.h index 27a10e9f8a..51a4b3f94b 100644 --- a/src/ripple/peerfinder/impl/iosformat.h +++ b/src/ripple/peerfinder/impl/iosformat.h @@ -61,7 +61,7 @@ std::basic_string heading ( /** Produce a dashed line separator, with a specified or default size. */ struct divider { - typedef char CharT; + using CharT = char; explicit divider (int width_ = 80, CharT fill_ = CharT ('-')) : width (width_) , fill (fill_) @@ -117,7 +117,7 @@ template string_t; + using string_t = std::basic_string ; field_t (string_t const& text_, int width_, int pad_, bool right_) : text (text_) , width (width_) diff --git a/src/ripple/peerfinder/sim/GraphAlgorithms.h b/src/ripple/peerfinder/sim/GraphAlgorithms.h index b7c8b20cf9..9d4fc6bf5f 100644 --- a/src/ripple/peerfinder/sim/GraphAlgorithms.h +++ b/src/ripple/peerfinder/sim/GraphAlgorithms.h @@ -35,13 +35,13 @@ struct VertexTraits; template void breadth_first_traverse (Vertex& start, Function f) { - typedef VertexTraits Traits; - typedef typename Traits::Edges Edges; - typedef typename Traits::Edge Edge; + using Traits = VertexTraits ; + using Edges = typename Traits::Edges; + using Edge = typename Traits::Edge; - typedef std::pair Probe; - typedef std::deque Work; - typedef std::set Visited; + using Probe = std::pair ; + using Work = std::deque ; + using Visited = std::set ; Work work; Visited visited; work.emplace_back (&start, 0); diff --git a/src/ripple/peerfinder/sim/Tests.cpp b/src/ripple/peerfinder/sim/Tests.cpp index b961b46b57..e6de29320f 100644 --- a/src/ripple/peerfinder/sim/Tests.cpp +++ b/src/ripple/peerfinder/sim/Tests.cpp @@ -31,16 +31,16 @@ class Network; class Node; // Maybe this should be std::set -typedef std::list Links; +using Links = std::list ; //------------------------------------------------------------------------------ class Network { public: - typedef std::list Peers; + using Peers = std::list ; - typedef hash_map > Table; + using Table = hash_map >; explicit Network (Params const& params, Journal journal = Journal()); @@ -81,7 +81,7 @@ class Node; class Link { public: - typedef std::vector Messages; + using Messages = std::vector ; Link ( Node& local_node, @@ -157,7 +157,7 @@ class Node , public Checker { private: - typedef std::vector SavedBootstrapAddresses; + using SavedBootstrapAddresses = std::vector ; public: struct Config @@ -694,8 +694,8 @@ void Network::step () template <> struct VertexTraits { - typedef Links Edges; - typedef Link Edge; + using Edges = Links; + using Edge = Link; static Edges& edges (Node& node) { return node.links(); } static Node* vertex (Link& l) @@ -945,7 +945,7 @@ void report_node_timeline (Node const& node, Stream const& stream) } // Entries - typedef std::vector History; + using History = std::vector ; History const& h (node.m_livecache_history); std::size_t step (0); for (typename History::const_iterator iter (h.begin()); diff --git a/src/ripple/peerfinder/sim/sync_timer.h b/src/ripple/peerfinder/sim/sync_timer.h deleted file mode 100644 index 7819d6fb4f..0000000000 --- a/src/ripple/peerfinder/sim/sync_timer.h +++ /dev/null @@ -1,39 +0,0 @@ -//------------------------------------------------------------------------------ -/* - This file is part of rippled: https://github.com/ripple/rippled - Copyright (c) 2012, 2013 Ripple Labs Inc. - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ -//============================================================================== - -#ifndef RIPPLE_PEERFINDER_SIM_SYNC_TIMER_H_INCLUDED -#define RIPPLE_PEERFINDER_SIM_SYNC_TIMER_H_INCLUDED - -//#include - -namespace beast { - -/** A synchronous timer. */ -template -class sync_deadline_timer -public: - typedef std::size_t duration_type; - typedef beast::implementation_type who; - typedef beast::service_type serviceType < - - implemetation (); - -} - -#endif diff --git a/src/ripple/protocol/Blob.h b/src/ripple/protocol/Blob.h index 5ca7d13097..bcebb7b85d 100644 --- a/src/ripple/protocol/Blob.h +++ b/src/ripple/protocol/Blob.h @@ -27,7 +27,7 @@ namespace ripple { /** Storage for linear binary data. Blocks of binary data appear often in various idioms and structures. */ -typedef std::vector Blob; +using Blob = std::vector ; } diff --git a/src/ripple/protocol/Book.h b/src/ripple/protocol/Book.h index 86ba29d5b8..5a207202e5 100644 --- a/src/ripple/protocol/Book.h +++ b/src/ripple/protocol/Book.h @@ -33,7 +33,7 @@ template class BookType { public: - typedef IssueType Issue; + using Issue = IssueType ; Issue in; Issue out; @@ -166,8 +166,8 @@ bool operator<= (BookType const& lhs, //------------------------------------------------------------------------------ -typedef BookType Book; -typedef BookType BookRef; +using Book = BookType ; +using BookRef = BookType ; } @@ -181,14 +181,14 @@ struct hash > , private boost::base_from_member , 1> { private: - typedef boost::base_from_member < - std::hash , 0> currency_hash_type; - typedef boost::base_from_member < - std::hash , 1> issuer_hash_type; + using currency_hash_type = boost::base_from_member < + std::hash , 0>; + using issuer_hash_type = boost::base_from_member < + std::hash , 1>; public: - typedef std::size_t value_type; - typedef ripple::IssueType argument_type; + using value_type = std::size_t; + using argument_type = ripple::IssueType ; value_type operator() (argument_type const& value) const { @@ -206,13 +206,13 @@ template struct hash > { private: - typedef std::hash > hasher; + using hasher = std::hash >; hasher m_hasher; public: - typedef std::size_t value_type; - typedef ripple::BookType argument_type; + using value_type = std::size_t; + using argument_type = ripple::BookType ; value_type operator() (argument_type const& value) const { @@ -232,7 +232,7 @@ template struct hash > : std::hash > { - typedef std::hash > Base; + using Base = std::hash >; // VFALCO NOTE broken in vs2012 //using Base::Base; // inherit ctors }; @@ -241,7 +241,7 @@ template struct hash > : std::hash > { - typedef std::hash > Base; + using Base = std::hash >; // VFALCO NOTE broken in vs2012 //using Base::Base; // inherit ctors }; diff --git a/src/ripple/protocol/Issue.h b/src/ripple/protocol/Issue.h index 2de3530b8b..c410c6c2d1 100644 --- a/src/ripple/protocol/Issue.h +++ b/src/ripple/protocol/Issue.h @@ -39,13 +39,11 @@ template class IssueType { public: - typedef typename - std::conditional ::type - IssueCurrency; + using IssueCurrency = typename + std::conditional ::type; - typedef typename - std::conditional ::type - IssueAccount; + using IssueAccount = typename + std::conditional ::type; IssueCurrency currency; IssueAccount account; @@ -173,8 +171,8 @@ bool operator<= (IssueType const& lhs, //------------------------------------------------------------------------------ -typedef IssueType Issue; -typedef IssueType IssueRef; +using Issue = IssueType ; +using IssueRef = IssueType ; //------------------------------------------------------------------------------ diff --git a/src/ripple/protocol/KnownFormats.h b/src/ripple/protocol/KnownFormats.h index cb27b002d0..30e95aada8 100644 --- a/src/ripple/protocol/KnownFormats.h +++ b/src/ripple/protocol/KnownFormats.h @@ -78,8 +78,8 @@ public: }; private: - typedef std::map NameMap; - typedef std::map TypeMap; + using NameMap = std::map ; + using TypeMap = std::map ; public: /** Create the known formats object. diff --git a/src/ripple/protocol/Protocol.h b/src/ripple/protocol/Protocol.h index 6b319e3f86..bea0db8b2f 100644 --- a/src/ripple/protocol/Protocol.h +++ b/src/ripple/protocol/Protocol.h @@ -69,7 +69,6 @@ using LedgerSeq = std::uint32_t; */ using TxID = uint256; -/** A transaction index. */ using TxSeq = std::uint32_t; } // ripple diff --git a/src/ripple/protocol/Quality.h b/src/ripple/protocol/Quality.h index 1d57d619e3..b5e3d7b8d0 100644 --- a/src/ripple/protocol/Quality.h +++ b/src/ripple/protocol/Quality.h @@ -86,7 +86,7 @@ class Quality public: // Type of the internal representation. Higher qualities // have lower unsigned integer representations. - typedef std::uint64_t value_type; + using value_type = std::uint64_t; private: value_type m_value; diff --git a/src/ripple/protocol/RippleAddress.h b/src/ripple/protocol/RippleAddress.h index b84e5be22d..8f9ff31808 100644 --- a/src/ripple/protocol/RippleAddress.h +++ b/src/ripple/protocol/RippleAddress.h @@ -40,7 +40,7 @@ namespace ripple { class RippleAddress : private CBase58Data { private: - typedef enum + enum VersionEncoding { VER_NONE = 1, VER_NODE_PUBLIC = 28, @@ -50,7 +50,7 @@ private: VER_ACCOUNT_PRIVATE = 34, VER_FAMILY_GENERATOR = 41, VER_FAMILY_SEED = 33, - } VersionEncoding; + }; bool mIsValid; diff --git a/src/ripple/protocol/SOTemplate.h b/src/ripple/protocol/SOTemplate.h index 1b3e60e800..6d0abf1668 100644 --- a/src/ripple/protocol/SOTemplate.h +++ b/src/ripple/protocol/SOTemplate.h @@ -60,8 +60,8 @@ public: class SOTemplate { public: - typedef std::unique_ptr value_type; - typedef std::vector list_type; + using value_type = std::unique_ptr ; + using list_type = std::vector ; /** Create an empty template. After creating the template, call @ref push_back with the diff --git a/src/ripple/protocol/STAmount.h b/src/ripple/protocol/STAmount.h index c65f5ea957..85a1e35ee7 100644 --- a/src/ripple/protocol/STAmount.h +++ b/src/ripple/protocol/STAmount.h @@ -42,9 +42,9 @@ class STAmount : public STBase { public: - typedef std::uint64_t mantissa_type; - typedef int exponent_type; - typedef std::pair rep; + using mantissa_type = std::uint64_t; + using exponent_type = int; + using rep = std::pair ; private: Issue mIssue; diff --git a/src/ripple/protocol/STBitString.h b/src/ripple/protocol/STBitString.h index 7dfb2721e7..ba6fc718d3 100644 --- a/src/ripple/protocol/STBitString.h +++ b/src/ripple/protocol/STBitString.h @@ -29,7 +29,7 @@ class STBitString final : public STBase { public: - typedef base_uint BitString; + using BitString = base_uint; STBitString () = default; diff --git a/src/ripple/protocol/STLedgerEntry.h b/src/ripple/protocol/STLedgerEntry.h index 9c31a2b408..5a05e91968 100644 --- a/src/ripple/protocol/STLedgerEntry.h +++ b/src/ripple/protocol/STLedgerEntry.h @@ -32,8 +32,8 @@ class STLedgerEntry final public: static char const* getCountedObjectName () { return "STLedgerEntry"; } - typedef std::shared_ptr pointer; - typedef const std::shared_ptr& ref; + using pointer = std::shared_ptr; + using ref = const std::shared_ptr&; public: STLedgerEntry (const Serializer & s, uint256 const& index); diff --git a/src/ripple/protocol/STTx.h b/src/ripple/protocol/STTx.h index c3b616b815..aaf7e65789 100644 --- a/src/ripple/protocol/STTx.h +++ b/src/ripple/protocol/STTx.h @@ -41,8 +41,8 @@ class STTx final public: static char const* getCountedObjectName () { return "STTx"; } - typedef std::shared_ptr pointer; - typedef const std::shared_ptr& ref; + using pointer = std::shared_ptr; + using ref = const std::shared_ptr&; static std::size_t const maxMultiSigners = 8; diff --git a/src/ripple/protocol/STValidation.h b/src/ripple/protocol/STValidation.h index 818b95877b..fdce28acbe 100644 --- a/src/ripple/protocol/STValidation.h +++ b/src/ripple/protocol/STValidation.h @@ -37,8 +37,8 @@ class STValidation final public: static char const* getCountedObjectName () { return "STValidation"; } - typedef std::shared_ptr pointer; - typedef const std::shared_ptr& ref; + using pointer = std::shared_ptr; + using ref = const std::shared_ptr&; enum { diff --git a/src/ripple/protocol/UintTypes.h b/src/ripple/protocol/UintTypes.h index e2ea198f70..8f15c35544 100644 --- a/src/ripple/protocol/UintTypes.h +++ b/src/ripple/protocol/UintTypes.h @@ -35,19 +35,19 @@ class NodeIDTag {}; /** Directory is an index into the directory of offer books. The last 64 bits of this are the quality. */ -typedef base_uint<256, detail::DirectoryTag> Directory; +using Directory = base_uint<256, detail::DirectoryTag>; /** Account is a hash representing a specific account. */ -typedef base_uint<160, detail::AccountTag> Account; +using Account = base_uint<160, detail::AccountTag>; /** Currency is a hash representing a specific currency. */ -typedef base_uint<160, detail::CurrencyTag> Currency; +using Currency = base_uint<160, detail::CurrencyTag>; /** NodeID is a 160-bit hash representing one node. */ -typedef base_uint<160, detail::NodeIDTag> NodeID; +using NodeID = base_uint<160, detail::NodeIDTag>; -typedef hash_set CurrencySet; -typedef hash_set NodeIDSet; +using CurrencySet = hash_set; +using NodeIDSet = hash_set; /** A special account that's used as the "issuer" for XRP. */ Account const& xrpAccount(); diff --git a/src/ripple/protocol/impl/ErrorCodes.cpp b/src/ripple/protocol/impl/ErrorCodes.cpp index ae6e25fc93..4b557ea96c 100644 --- a/src/ripple/protocol/impl/ErrorCodes.cpp +++ b/src/ripple/protocol/impl/ErrorCodes.cpp @@ -42,7 +42,7 @@ namespace detail { class ErrorCategory { public: - using Map = std::unordered_map ; + using Map = std::unordered_map ; ErrorCategory () : m_unknown (rpcUNKNOWN, "unknown", "An unknown error code.") diff --git a/src/ripple/protocol/impl/RippleAddress.cpp b/src/ripple/protocol/impl/RippleAddress.cpp index e70dbadbbc..4ac4abd05f 100644 --- a/src/ripple/protocol/impl/RippleAddress.cpp +++ b/src/ripple/protocol/impl/RippleAddress.cpp @@ -355,8 +355,8 @@ Account RippleAddress::getAccountID () const } } -typedef std::mutex StaticLockType; -typedef std::lock_guard StaticScopedLockType; +using StaticLockType = std::mutex; +using StaticScopedLockType = std::lock_guard ; static StaticLockType s_lock; static hash_map rncMapOld, rncMapNew; diff --git a/src/ripple/protocol/impl/SField.cpp b/src/ripple/protocol/impl/SField.cpp index c87b9e765f..5597fd15de 100644 --- a/src/ripple/protocol/impl/SField.cpp +++ b/src/ripple/protocol/impl/SField.cpp @@ -39,7 +39,7 @@ SField::IsSigning const SField::notSigning; int SField::num = 0; -typedef std::lock_guard StaticScopedLockType; +using StaticScopedLockType = std::lock_guard ; // Give this translation unit only, permission to construct SFields struct SField::make diff --git a/src/ripple/protocol/tests/STAmount.test.cpp b/src/ripple/protocol/tests/STAmount.test.cpp index 2bef5007e5..11b7272ca7 100644 --- a/src/ripple/protocol/tests/STAmount.test.cpp +++ b/src/ripple/protocol/tests/STAmount.test.cpp @@ -131,7 +131,7 @@ public: STAmount const amount = amountFromString (issue, value); expect (amount.getText () == value, "format " + value); } - catch (std::exception const& e) + catch (std::exception const&) { expect (!success, "parse " + value + " should fail"); } diff --git a/src/ripple/resource/Charge.h b/src/ripple/resource/Charge.h index 0df8ffc201..2ee9a26977 100644 --- a/src/ripple/resource/Charge.h +++ b/src/ripple/resource/Charge.h @@ -31,7 +31,7 @@ class Charge { public: /** The type used to hold a consumption charge. */ - typedef int value_type; + using value_type = int; // A default constructed Charge has no way to get a label. Delete Charge () = delete; diff --git a/src/ripple/resource/impl/Entry.h b/src/ripple/resource/impl/Entry.h index 3dd0b8d083..ee814facdd 100644 --- a/src/ripple/resource/impl/Entry.h +++ b/src/ripple/resource/impl/Entry.h @@ -29,7 +29,7 @@ namespace ripple { namespace Resource { -typedef beast::abstract_clock clock_type; +using clock_type = beast::abstract_clock ; // An entry in the table // VFALCO DEPRECATED using boost::intrusive list diff --git a/src/ripple/resource/impl/Logic.h b/src/ripple/resource/impl/Logic.h index 0e5e607f9c..537a2a3484 100644 --- a/src/ripple/resource/impl/Logic.h +++ b/src/ripple/resource/impl/Logic.h @@ -37,10 +37,10 @@ namespace Resource { class Logic { private: - typedef beast::abstract_clock clock_type; - typedef hash_map Imports; - typedef hash_map Table; - typedef beast::List EntryIntrusiveList; + using clock_type = beast::abstract_clock ; + using Imports = hash_map ; + using Table = hash_map ; + using EntryIntrusiveList = beast::List ; struct State { @@ -67,7 +67,7 @@ private: Imports import_table; }; - typedef beast::SharedData SharedState; + using SharedState = beast::SharedData ; struct Stats { diff --git a/src/ripple/resource/tests/Logic.test.cpp b/src/ripple/resource/tests/Logic.test.cpp index 936d7be91e..ecc3d82523 100644 --- a/src/ripple/resource/tests/Logic.test.cpp +++ b/src/ripple/resource/tests/Logic.test.cpp @@ -37,8 +37,8 @@ public: { private: - typedef boost::base_from_member < - beast::manual_clock > clock_type; + using clock_type = boost::base_from_member < + beast::manual_clock >; public: explicit TestLogic (beast::Journal journal) diff --git a/src/ripple/rpc/InternalHandler.h b/src/ripple/rpc/InternalHandler.h index 703a409d78..3a4497cb6a 100644 --- a/src/ripple/rpc/InternalHandler.h +++ b/src/ripple/rpc/InternalHandler.h @@ -27,7 +27,7 @@ namespace RPC { * instance of InternalHandler with your own handler function. */ struct InternalHandler { - typedef Json::Value (*handler_t) (const Json::Value&); + using handler_t = Json::Value (*) (const Json::Value&); InternalHandler (const std::string& name, handler_t handler) : name_ (name), diff --git a/src/ripple/rpc/Manager.h b/src/ripple/rpc/Manager.h index 9686917374..5e070246de 100644 --- a/src/ripple/rpc/Manager.h +++ b/src/ripple/rpc/Manager.h @@ -30,7 +30,7 @@ namespace RPC { class Manager { public: - typedef std::function handler_type; + using handler_type = std::function ; virtual ~Manager () = 0; diff --git a/src/ripple/rpc/handlers/LogLevel.cpp b/src/ripple/rpc/handlers/LogLevel.cpp index 33a83f5c83..476972a925 100644 --- a/src/ripple/rpc/handlers/LogLevel.cpp +++ b/src/ripple/rpc/handlers/LogLevel.cpp @@ -35,7 +35,7 @@ Json::Value doLogLevel (RPC::Context& context) Logs::toString(Logs::fromSeverity(deprecatedLogs().severity())); std::vector< std::pair > logTable ( deprecatedLogs().partition_severities()); - typedef std::map::value_type stringPair; + using stringPair = std::map::value_type; for (auto const& it : logTable) lev[it.first] = it.second; diff --git a/src/ripple/rpc/impl/Manager.cpp b/src/ripple/rpc/impl/Manager.cpp index eecb382e49..4015ba9470 100644 --- a/src/ripple/rpc/impl/Manager.cpp +++ b/src/ripple/rpc/impl/Manager.cpp @@ -28,7 +28,7 @@ namespace RPC { class ManagerImp : public Manager { public: - typedef hash_map Map; + using Map = hash_map ; beast::Journal m_journal; Map m_map; diff --git a/src/ripple/server/impl/ServerImpl.h b/src/ripple/server/impl/ServerImpl.h index 73f0fbed55..1b7cb2b1cb 100644 --- a/src/ripple/server/impl/ServerImpl.h +++ b/src/ripple/server/impl/ServerImpl.h @@ -68,14 +68,14 @@ private: using list_type = boost::intrusive::make_list >::type; - typedef std::chrono::system_clock clock_type; + using clock_type = std::chrono::system_clock; enum { historySize = 100 }; - typedef std::vector > Doors; + using Doors = std::vector >; Handler& handler_; beast::Journal journal_; diff --git a/src/ripple/server/tests/Server.test.cpp b/src/ripple/server/tests/Server.test.cpp index 859f05f014..6ba9dfd042 100644 --- a/src/ripple/server/tests/Server.test.cpp +++ b/src/ripple/server/tests/Server.test.cpp @@ -215,7 +215,7 @@ public: test_request() { boost::asio::io_service ios; - typedef boost::asio::ip::tcp::socket socket; + using socket = boost::asio::ip::tcp::socket; socket s (ios); if (! connect (s, "127.0.0.1", testPort)) @@ -247,7 +247,7 @@ public: test_keepalive() { boost::asio::io_service ios; - typedef boost::asio::ip::tcp::socket socket; + using socket = boost::asio::ip::tcp::socket; socket s (ios); if (! connect (s, "127.0.0.1", testPort)) diff --git a/src/ripple/shamap/FullBelowCache.h b/src/ripple/shamap/FullBelowCache.h index ca091ad5a8..0ebcf282f3 100644 --- a/src/ripple/shamap/FullBelowCache.h +++ b/src/ripple/shamap/FullBelowCache.h @@ -48,7 +48,7 @@ public: using key_type = Key; using size_type = typename CacheType::size_type; - using clock_type = typename CacheType::clock_type ; + using clock_type = typename CacheType::clock_type; /** Construct the cache. diff --git a/src/ripple/shamap/SHAMap.h b/src/ripple/shamap/SHAMap.h index 198bedcf87..5090bf970a 100644 --- a/src/ripple/shamap/SHAMap.h +++ b/src/ripple/shamap/SHAMap.h @@ -177,7 +177,7 @@ public: void walkMap (std::vector& missingNodes, int maxMissing) const; bool deepCompare (SHAMap & other) const; - typedef std::pair fetchPackEntry_t; + using fetchPackEntry_t = std::pair ; void visitDifferences (SHAMap * have, std::function) const; @@ -192,7 +192,7 @@ private: using SharedPtrNodeStack = std::stack, SHAMapNodeID>>; using DeltaRef = std::pair const&, - std::shared_ptr const&> ; + std::shared_ptr const&>; int unshare (); diff --git a/src/ripple/shamap/tests/FetchPack.test.cpp b/src/ripple/shamap/tests/FetchPack.test.cpp index e93c1a843d..4c8300753a 100644 --- a/src/ripple/shamap/tests/FetchPack.test.cpp +++ b/src/ripple/shamap/tests/FetchPack.test.cpp @@ -41,9 +41,9 @@ public: tableItemsExtra = 20 }; - using Map = hash_map ; + using Map = hash_map ; using Table = SHAMap; - using Item = SHAMapItem; + using Item = SHAMapItem; struct Handler { diff --git a/src/ripple/unity/snappy.cpp b/src/ripple/unity/snappy.cpp index 36b8db22dc..3fa212ebdd 100644 --- a/src/ripple/unity/snappy.cpp +++ b/src/ripple/unity/snappy.cpp @@ -23,7 +23,7 @@ #ifdef _MSC_VER #include namespace snappy { -typedef std::ptrdiff_t ssize_t; +using ssize_t = std::ptrdiff_t; } #endif diff --git a/src/ripple/websocket/AutoSocket.h b/src/ripple/websocket/AutoSocket.h index 5033e6b883..8f954800a6 100644 --- a/src/ripple/websocket/AutoSocket.h +++ b/src/ripple/websocket/AutoSocket.h @@ -36,14 +36,14 @@ class AutoSocket { public: - typedef boost::asio::ssl::stream ssl_socket; - typedef boost::asio::ip::tcp::socket::endpoint_type endpoint_type; - typedef std::shared_ptr socket_ptr; - typedef ssl_socket::next_layer_type plain_socket; - typedef ssl_socket::lowest_layer_type lowest_layer_type; - typedef ssl_socket::handshake_type handshake_type; - typedef boost::system::error_code error_code; - typedef std::function callback; + using ssl_socket = boost::asio::ssl::stream; + using endpoint_type = boost::asio::ip::tcp::socket::endpoint_type; + using socket_ptr = std::shared_ptr; + using plain_socket = ssl_socket::next_layer_type; + using lowest_layer_type = ssl_socket::lowest_layer_type; + using handshake_type = ssl_socket::handshake_type; + using error_code = boost::system::error_code; + using callback = std::function ; public: AutoSocket (boost::asio::io_service& s, boost::asio::ssl::context& c) diff --git a/src/ripple/websocket/Config04.h b/src/ripple/websocket/Config04.h index 1ded954cbd..2e72f39298 100644 --- a/src/ripple/websocket/Config04.h +++ b/src/ripple/websocket/Config04.h @@ -37,35 +37,33 @@ namespace websocket { using ConfigBase04 = websocketpp::config::core; struct Config04 : ConfigBase04 { - typedef ConfigBase04 base; - typedef Config04 type; - typedef base::concurrency_type concurrency_type; + using base = ConfigBase04; + using type = Config04; + using concurrency_type = base::concurrency_type; - typedef base::request_type request_type; - typedef base::response_type response_type; + using request_type = base::request_type; + using response_type = base::response_type; - typedef base::message_type message_type; - typedef base::con_msg_manager_type con_msg_manager_type; - typedef base::endpoint_msg_manager_type endpoint_msg_manager_type; + using message_type = base::message_type; + using con_msg_manager_type = base::con_msg_manager_type; + using endpoint_msg_manager_type = base::endpoint_msg_manager_type; - typedef Logger alog_type; - typedef Logger elog_type; + using alog_type = Logger ; + using elog_type = Logger ; - typedef base::rng_type rng_type; + using rng_type = base::rng_type; struct transport_config : public base::transport_config { - typedef type::concurrency_type concurrency_type; - typedef type::alog_type alog_type; - typedef type::elog_type elog_type; - typedef type::request_type request_type; - typedef type::response_type response_type; - // typedef AutoSocket - typedef websocketpp::transport::asio::basic_socket::endpoint - socket_type; + using concurrency_type = type::concurrency_type; + using alog_type = type::alog_type; + using elog_type = type::elog_type; + using request_type = type::request_type; + using response_type = type::response_type; + using socket_type = websocketpp::transport::asio::basic_socket::endpoint; }; - typedef websocketpp::transport::asio::endpoint - transport_type; + using transport_type = websocketpp::transport::asio::endpoint + ; }; } // websocket diff --git a/src/ripple/websocket/Handler.h b/src/ripple/websocket/Handler.h index 687a739761..dac51fb7cc 100644 --- a/src/ripple/websocket/Handler.h +++ b/src/ripple/websocket/Handler.h @@ -63,7 +63,7 @@ class HandlerImpl public: using connection_ptr = typename WebSocket::ConnectionPtr; using message_ptr = typename WebSocket::MessagePtr; - using wsc_ptr = std::shared_ptr > ; + using wsc_ptr = std::shared_ptr >; // Private reasons to close. enum @@ -83,7 +83,7 @@ protected: std::mutex mLock; // For each connection maintain an associated object to track subscriptions. - typedef hash_map MapType; + using MapType = hash_map ; MapType mMap; public: