From 4f990714b13e0b4446305a5411648a1a9ae42a7a Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Wed, 14 Jul 2021 12:45:13 +0100 Subject: Modernize typedefs with `using`. Replace many occurences of `typedef` with `using`. For now, do not update typedefs for function types and aligned types and do not touch some parts such as jvmti or dmtracedump. Test: m Change-Id: Ie97ecbc5abf7e7109ef4b01f208752e2dc26c36d --- compiler/utils/swap_space.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'compiler/utils/swap_space.h') diff --git a/compiler/utils/swap_space.h b/compiler/utils/swap_space.h index 76df527108..a472943518 100644 --- a/compiler/utils/swap_space.h +++ b/compiler/utils/swap_space.h @@ -66,7 +66,7 @@ class SwapSpace { } }; - typedef std::set FreeByStartSet; + using FreeByStartSet = std::set; // Map size to an iterator to free_by_start_'s entry. struct FreeBySizeEntry { @@ -87,7 +87,7 @@ class SwapSpace { } } }; - typedef std::set FreeBySizeSet; + using FreeBySizeSet = std::set; SpaceChunk NewFileChunk(size_t min_size) REQUIRES(lock_); @@ -113,13 +113,13 @@ template class SwapAllocator; template <> class SwapAllocator { public: - typedef void value_type; - typedef void* pointer; - typedef const void* const_pointer; + using value_type = void; + using pointer = void*; + using const_pointer = const void*; template struct rebind { - typedef SwapAllocator other; + using other = SwapAllocator; }; explicit SwapAllocator(SwapSpace* swap_space) : swap_space_(swap_space) {} @@ -145,17 +145,17 @@ class SwapAllocator { template class SwapAllocator { public: - typedef T value_type; - typedef T* pointer; - typedef T& reference; - typedef const T* const_pointer; - typedef const T& const_reference; - typedef size_t size_type; - typedef ptrdiff_t difference_type; + using value_type = T; + using pointer = T*; + using reference = T&; + using const_pointer = const T*; + using const_reference = const T&; + using size_type = size_t; + using difference_type = ptrdiff_t; template struct rebind { - typedef SwapAllocator other; + using other = SwapAllocator; }; explicit SwapAllocator(SwapSpace* swap_space) : swap_space_(swap_space) {} -- cgit v1.2.3-59-g8ed1b