diff options
Diffstat (limited to 'src/lib/netlist/plib/pstring.h')
-rw-r--r-- | src/lib/netlist/plib/pstring.h | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/src/lib/netlist/plib/pstring.h b/src/lib/netlist/plib/pstring.h index a4c4936cffc..6625ddb11f9 100644 --- a/src/lib/netlist/plib/pstring.h +++ b/src/lib/netlist/plib/pstring.h @@ -66,12 +66,12 @@ struct pstring_t public: using traits_type = F; - typedef typename traits_type::mem_t mem_t; - typedef typename traits_type::code_t code_t; - typedef typename traits_type::code_t value_type; - typedef std::size_t size_type; - typedef std::ptrdiff_t difference_type; - typedef typename traits_type::string_type string_type; + using mem_t = typename traits_type::mem_t; + using code_t = typename traits_type::code_t; + using value_type = typename traits_type::code_t; + using size_type = std::size_t; + using difference_type = std::ptrdiff_t; + using string_type = typename traits_type::string_type; // FIXME: this is ugly class ref_value_type final @@ -87,8 +87,8 @@ public: private: const mem_t m; }; - typedef const ref_value_type& const_reference; - typedef const_reference reference; + using const_reference = const ref_value_type &; + using reference = const_reference; // simple construction/destruction pstring_t() = default; @@ -153,8 +153,8 @@ public: } // no non-const const_iterator for now - typedef pstring_const_iterator<pstring_t> iterator; - typedef pstring_const_iterator<pstring_t> const_iterator; + using iterator = pstring_const_iterator<pstring_t<F> >; + using const_iterator = pstring_const_iterator<pstring_t<F> >; iterator begin() { return iterator(m_str.begin()); } iterator end() { return iterator(m_str.end()); } @@ -215,9 +215,9 @@ private: struct pu8_traits { - typedef char mem_t; - typedef char code_t; - typedef std::string string_type; + using mem_t = char; + using code_t = char; + using string_type = std::string; static std::size_t len(const string_type &p) { return p.size(); } static std::size_t codelen(const mem_t *p) { plib::unused_var(p); return 1; } static std::size_t codelen(const code_t c) { plib::unused_var(c); return 1; } @@ -229,9 +229,9 @@ struct pu8_traits /* No checking, this may deliver invalid codes */ struct putf8_traits { - typedef char mem_t; - typedef char32_t code_t; - typedef std::string string_type; + using mem_t = char; + using code_t = char32_t; + using string_type = std::string; static std::size_t len(const string_type &p) { std::size_t ret = 0; @@ -320,9 +320,9 @@ struct putf8_traits struct putf16_traits { - typedef char16_t mem_t; - typedef char32_t code_t; - typedef std::u16string string_type; + using mem_t = char16_t; + using code_t = char32_t; + using string_type = std::u16string; static std::size_t len(const string_type &p) { std::size_t ret = 0; @@ -384,9 +384,9 @@ struct putf16_traits struct pwchar_traits { - typedef wchar_t mem_t; - typedef char32_t code_t; - typedef std::wstring string_type; + using mem_t = wchar_t; + using code_t = char32_t; + using string_type = std::wstring; static std::size_t len(const string_type &p) { if (sizeof(wchar_t) == 2) @@ -481,24 +481,24 @@ extern template struct pstring_t<pwchar_traits>; #if (PSTRING_USE_STD_STRING) typedef std::string pstring; #else -typedef pstring_t<putf8_traits> pstring; +using pstring = pstring_t<putf8_traits>; #endif -typedef pstring_t<putf8_traits> putf8string; -typedef pstring_t<putf16_traits> pu16string; -typedef pstring_t<pwchar_traits> pwstring; +using putf8string = pstring_t<putf8_traits>; +using pu16string = pstring_t<putf16_traits>; +using pwstring = pstring_t<pwchar_traits>; namespace plib { template<class T> struct string_info { - typedef typename T::mem_t mem_t; + using mem_t = typename T::mem_t; }; template<> struct string_info<std::string> { - typedef char mem_t; + using mem_t = char; }; template<typename T> @@ -554,7 +554,7 @@ namespace plib decltype(arg.c_str()) cstr = arg.c_str(); std::size_t idx(0); auto ret = pstonum_helper<T>()(cstr, &idx); - typedef decltype(ret) ret_type; + using ret_type = decltype(ret); if (ret >= static_cast<ret_type>(std::numeric_limits<T>::lowest()) && ret <= static_cast<ret_type>(std::numeric_limits<T>::max())) //&& (ret == T(0) || std::abs(ret) >= std::numeric_limits<T>::min() )) @@ -741,8 +741,8 @@ namespace std template<typename T> struct hash<pstring_t<T>> { - typedef pstring_t<T> argument_type; - typedef std::size_t result_type; + using argument_type = pstring_t<T>; + using result_type = std::size_t; result_type operator()(argument_type const& s) const { const typename argument_type::mem_t *string = s.c_str(); |