From 3a7be39be91f643b5ae1cb64e4f1b86eba7bdc38 Mon Sep 17 00:00:00 2001 From: LIU Hao Date: Wed, 7 Feb 2024 15:59:47 +0800 Subject: [PATCH] *: Rename template parameters --- asteria/compiler/expression_unit.hpp | 20 ++--- asteria/compiler/infix_element.hpp | 20 ++--- asteria/compiler/statement.hpp | 20 ++--- asteria/compiler/token.hpp | 8 +- asteria/compiler/token_stream.cpp | 6 +- asteria/details/value.ipp | 106 ++++++++++++------------- asteria/fwd.hpp | 12 +-- asteria/runtime/air_node.cpp | 6 +- asteria/runtime/air_node.hpp | 20 ++--- asteria/runtime/reference.hpp | 16 ++-- asteria/runtime/reference_modifier.hpp | 20 ++--- asteria/runtime/runtime_error.hpp | 6 +- asteria/runtime/variable.hpp | 8 +- asteria/value.hpp | 30 +++---- 14 files changed, 149 insertions(+), 149 deletions(-) diff --git a/asteria/compiler/expression_unit.hpp b/asteria/compiler/expression_unit.hpp index 6d43bd38f..fe9bcf814 100644 --- a/asteria/compiler/expression_unit.hpp +++ b/asteria/compiler/expression_unit.hpp @@ -147,22 +147,22 @@ class Expression_Unit public: // Constructors and assignment operators - template::value)> + template::value)> constexpr - Expression_Unit(XUnitT&& xunit) - noexcept(::std::is_nothrow_constructible::value) + Expression_Unit(xUnitT&& xunit) + noexcept(::std::is_nothrow_constructible::value) : - m_stor(forward(xunit)) + m_stor(forward(xunit)) { } - template::value)> + template::value)> Expression_Unit& - operator=(XUnitT&& xunit) & - noexcept(::std::is_nothrow_assignable::value) + operator=(xUnitT&& xunit) & + noexcept(::std::is_nothrow_assignable::value) { - this->m_stor = forward(xunit); + this->m_stor = forward(xunit); return *this; } diff --git a/asteria/compiler/infix_element.hpp b/asteria/compiler/infix_element.hpp index 26386320d..20657e7fb 100644 --- a/asteria/compiler/infix_element.hpp +++ b/asteria/compiler/infix_element.hpp @@ -76,22 +76,22 @@ class Infix_Element public: // Constructors and assignment operators - template::value)> + template::value)> constexpr - Infix_Element(XElemT&& xelem) - noexcept(::std::is_nothrow_constructible::value) + Infix_Element(xElementT&& xelem) + noexcept(::std::is_nothrow_constructible::value) : - m_stor(forward(xelem)) + m_stor(forward(xelem)) { } - template::value)> + template::value)> Infix_Element& - operator=(XElemT&& xelem) & - noexcept(::std::is_nothrow_assignable::value) + operator=(xElementT&& xelem) & + noexcept(::std::is_nothrow_assignable::value) { - this->m_stor = forward(xelem); + this->m_stor = forward(xelem); return *this; } diff --git a/asteria/compiler/statement.hpp b/asteria/compiler/statement.hpp index ca76bb94b..1ec389830 100644 --- a/asteria/compiler/statement.hpp +++ b/asteria/compiler/statement.hpp @@ -200,22 +200,22 @@ class Statement public: // Constructors and assignment operators - template::value)> + template::value)> constexpr - Statement(XStmtT&& xstmt) - noexcept(::std::is_nothrow_constructible::value) + Statement(xStatementT&& xstmt) + noexcept(::std::is_nothrow_constructible::value) : - m_stor(forward(xstmt)) + m_stor(forward(xstmt)) { } - template::value)> + template::value)> Statement& - operator=(XStmtT&& xstmt) & - noexcept(::std::is_nothrow_assignable::value) + operator=(xStatementT&& xstmt) & + noexcept(::std::is_nothrow_assignable::value) { - this->m_stor = forward(xstmt); + this->m_stor = forward(xstmt); return *this; } diff --git a/asteria/compiler/token.hpp b/asteria/compiler/token.hpp index c3135dfe6..5d862a303 100644 --- a/asteria/compiler/token.hpp +++ b/asteria/compiler/token.hpp @@ -67,12 +67,12 @@ class Token ); public: - template + template constexpr - Token(const Source_Location& xsloc, size_t xlen, XTokT&& xtok) - noexcept(::std::is_nothrow_constructible::value) + Token(const Source_Location& xsloc, size_t xlen, xTokenT&& xtok) + noexcept(::std::is_nothrow_constructible::value) : - m_sloc(xsloc), m_length(xlen), m_stor(forward(xtok)) + m_sloc(xsloc), m_length(xlen), m_stor(forward(xtok)) { } Token& diff --git a/asteria/compiler/token_stream.cpp b/asteria/compiler/token_stream.cpp index fe6d8097b..eb1e96951 100644 --- a/asteria/compiler/token_stream.cpp +++ b/asteria/compiler/token_stream.cpp @@ -109,11 +109,11 @@ class Text_Reader } }; -template +template bool -do_push_token(cow_vector& tokens, Text_Reader& reader, size_t tlen, XTokenT&& xtoken) +do_push_token(cow_vector& tokens, Text_Reader& reader, size_t tlen, xTokenT&& xtoken) { - tokens.emplace_back(reader.tell(), tlen, forward(xtoken)); + tokens.emplace_back(reader.tell(), tlen, forward(xtoken)); reader.consume(tlen); return true; } diff --git a/asteria/details/value.ipp b/asteria/details/value.ipp index c02ad29ea..6218d1b78 100644 --- a/asteria/details/value.ipp +++ b/asteria/details/value.ipp @@ -35,10 +35,10 @@ struct Valuable_impl using direct_init = ::std::true_type; using via_type = V_boolean; - template + template static void - assign(StorT& stor, XValT&& xval) + assign(StorT& stor, xValueT&& xval) { stor = V_boolean(xval); } @@ -53,10 +53,10 @@ struct Valuable_impl + template static void - assign(StorT& stor, XValT&& xval) + assign(StorT& stor, xValueT&& xval) { stor = V_integer(xval); } @@ -71,10 +71,10 @@ struct Valuable_impl + template static void - assign(StorT& stor, XValT&& xval) + assign(StorT& stor, xValueT&& xval) { stor = V_real(xval); } @@ -89,12 +89,12 @@ struct Valuable_impl + template static void - assign(StorT& stor, XValT&& xval) + assign(StorT& stor, xValueT&& xval) { - stor = V_string(forward(xval)); + stor = V_string(forward(xval)); } }; @@ -104,12 +104,12 @@ struct Valuable_impl using direct_init = ::std::true_type; using via_type = V_string; - template + template static void - assign(StorT& stor, XValT&& xval) + assign(StorT& stor, xValueT&& xval) { - stor = V_string(forward(xval)); + stor = V_string(forward(xval)); } }; @@ -119,13 +119,13 @@ struct Valuable_impl using direct_init = ::std::false_type; using via_type = V_opaque; - template + template static void - assign(StorT& stor, XValT&& xval) + assign(StorT& stor, xValueT&& xval) { if(xval) - stor = V_opaque(forward(xval)); + stor = V_opaque(forward(xval)); else stor = V_null(); } @@ -140,13 +140,13 @@ struct Valuable_impl, typename ::std::enable_if< using direct_init = ::std::false_type; using via_type = V_opaque; - template + template static void - assign(StorT& stor, XValT&& xval) + assign(StorT& stor, xValueT&& xval) { if(xval) - stor = V_opaque(forward(xval)); + stor = V_opaque(forward(xval)); else stor = V_null(); } @@ -158,13 +158,13 @@ struct Valuable_impl using direct_init = ::std::false_type; using via_type = V_function; - template + template static void - assign(StorT& stor, XValT&& xval) + assign(StorT& stor, xValueT&& xval) { if(xval) - stor = V_function(forward(xval)); + stor = V_function(forward(xval)); else stor = V_null(); } @@ -179,13 +179,13 @@ struct Valuable_impl, typename ::std::enable_if< using direct_init = ::std::false_type; using via_type = V_function; - template + template static void - assign(StorT& stor, XValT&& xval) + assign(StorT& stor, xValueT&& xval) { if(xval) - stor = V_function(forward(xval)); + stor = V_function(forward(xval)); else stor = V_null(); } @@ -197,12 +197,12 @@ struct Valuable_impl using direct_init = ::std::true_type; using via_type = V_array; - template + template static void - assign(StorT& stor, XValT&& xval) + assign(StorT& stor, xValueT&& xval) { - stor = V_array(forward(xval)); + stor = V_array(forward(xval)); } }; @@ -212,32 +212,32 @@ struct Valuable_impl using direct_init = ::std::true_type; using via_type = V_object; - template + template static void - assign(StorT& stor, XValT&& xval) + assign(StorT& stor, xValueT&& xval) { - stor = V_object(forward(xval)); + stor = V_object(forward(xval)); } }; -template -struct Valuable_impl +template +struct Valuable_impl { using direct_init = ::std::false_type; using via_type = V_array; - template + template static void - assign(StorT& stor, XArrT&& xarr) + assign(StorT& stor, xArrT&& xarr) { V_array arr; arr.reserve(N); for(size_t k = 0; k != N; ++k) arr.emplace_back(static_cast::value, - const XValT&, XValT&&>::type>(xarr[k])); + ::std::is_lvalue_reference::value, + const xValueT&, xValueT&&>::type>(xarr[k])); stor = move(arr); } }; @@ -250,56 +250,56 @@ struct Valuable_impl + template static void unpack_tuple_aux(V_array& arr, ::std::index_sequence, - XTupT&& xtup) + xTupT&& xtup) { int dummy[] = { (static_cast(arr.emplace_back( - ::std::get(forward(xtup)))), 1)... }; + ::std::get(forward(xtup)))), 1)... }; (void)dummy; } - template + template static void - assign(StorT& stor, XTupT&& xtup) + assign(StorT& stor, xTupT&& xtup) { V_array arr; constexpr size_t N = ::std::tuple_size::value; arr.reserve(N); unpack_tuple_aux(arr, ::std::make_index_sequence(), - forward(xtup)); + forward(xtup)); stor = move(arr); } }; -template -struct Valuable_impl, typename ::std::conditional< - true, void, typename Valuable_impl::via_type +template +struct Valuable_impl, typename ::std::conditional< + true, void, typename Valuable_impl::via_type >::type> { using direct_init = ::std::false_type; - using via_type = typename Valuable_impl::via_type; + using via_type = typename Valuable_impl::via_type; - template + template static void - assign(StorT& stor, XOptT&& xopt) + assign(StorT& stor, xOptT&& xopt) { if(xopt) - Valuable_impl::assign(stor, + Valuable_impl::assign(stor, static_cast::value, - const XValT&, XValT&&>::type>(*xopt)); + ::std::is_lvalue_reference::value, + const xValueT&, xValueT&&>::type>(*xopt)); else stor = V_null(); } }; -template -using Valuable = Valuable_impl::type, void>; +template +using Valuable = Valuable_impl::type, void>; inline void diff --git a/asteria/fwd.hpp b/asteria/fwd.hpp index 14ef77dbb..cd2c4d6b5 100644 --- a/asteria/fwd.hpp +++ b/asteria/fwd.hpp @@ -263,15 +263,15 @@ struct rcfwd : virtual Rcbase void vtable_key_function_GklPAslB() noexcept; - template - refcnt_ptr + template + refcnt_ptr share_this() const - { return this->Rcbase::template share_this(); } + { return this->Rcbase::template share_this(); } - template - refcnt_ptr + template + refcnt_ptr share_this() - { return this->Rcbase::template share_this(); } + { return this->Rcbase::template share_this(); } }; template diff --git a/asteria/runtime/air_node.cpp b/asteria/runtime/air_node.cpp index 279b57d6d..8444f4a88 100644 --- a/asteria/runtime/air_node.cpp +++ b/asteria/runtime/air_node.cpp @@ -66,11 +66,11 @@ do_solidify_nodes(AVM_Rod& rod, const cow_vector& code) rod.finalize(); } -template +template void -do_push_modifier_and_check(Reference& ref, XModT&& xmod) +do_push_modifier_and_check(Reference& ref, xModifierT&& xmod) { - ref.push_modifier(forward(xmod)); + ref.push_modifier(forward(xmod)); ref.dereference_readonly(); } diff --git a/asteria/runtime/air_node.hpp b/asteria/runtime/air_node.hpp index 7ab9d5dee..59e0de7de 100644 --- a/asteria/runtime/air_node.hpp +++ b/asteria/runtime/air_node.hpp @@ -382,22 +382,22 @@ class AIR_Node public: // Constructors and assignment operators - template::value)> + template::value)> constexpr - AIR_Node(XNodeT&& xnode) - noexcept(::std::is_nothrow_constructible::value) + AIR_Node(xNodeT&& xnode) + noexcept(::std::is_nothrow_constructible::value) : - m_stor(forward(xnode)) + m_stor(forward(xnode)) { } - template::value)> + template::value)> AIR_Node& - operator=(XNodeT&& xnode) & - noexcept(::std::is_nothrow_assignable::value) + operator=(xNodeT&& xnode) & + noexcept(::std::is_nothrow_assignable::value) { - this->m_stor = forward(xnode); + this->m_stor = forward(xnode); return *this; } diff --git a/asteria/runtime/reference.hpp b/asteria/runtime/reference.hpp index 35ec4b257..1f94755c7 100644 --- a/asteria/runtime/reference.hpp +++ b/asteria/runtime/reference.hpp @@ -134,12 +134,12 @@ class Reference is_temporary() const noexcept { return this->m_xref == xref_temporary; } - template::value)> + template::value)> Reference& - set_temporary(XValT&& xval) + set_temporary(xValueT&& xval) { - this->m_value = forward(xval); + this->m_value = forward(xval); this->m_mods.clear(); this->m_xref = xref_temporary; return *this; @@ -183,15 +183,15 @@ class Reference clear_modifiers() noexcept { this->m_mods.clear(); } - template::value)> + template::value)> Reference& - push_modifier(XModT&& xmod) + push_modifier(xModifierT&& xmod) { if((this->m_xref != xref_temporary) && (this->m_xref != xref_variable)) this->do_throw_not_dereferenceable(); - this->m_mods.emplace_back(forward(xmod)); + this->m_mods.emplace_back(forward(xmod)); return *this; } diff --git a/asteria/runtime/reference_modifier.hpp b/asteria/runtime/reference_modifier.hpp index 536383947..2172074d6 100644 --- a/asteria/runtime/reference_modifier.hpp +++ b/asteria/runtime/reference_modifier.hpp @@ -54,22 +54,22 @@ class Reference_Modifier public: // Constructors and assignment operators - template::value)> + template::value)> constexpr - Reference_Modifier(XModT&& xmod) - noexcept(::std::is_nothrow_constructible::value) + Reference_Modifier(xModifierT&& xmod) + noexcept(::std::is_nothrow_constructible::value) : - m_stor(forward(xmod)) + m_stor(forward(xmod)) { } - template::value)> + template::value)> Reference_Modifier& - operator=(XModT&& xmod) & - noexcept(::std::is_nothrow_assignable::value) + operator=(xModifierT&& xmod) & + noexcept(::std::is_nothrow_assignable::value) { - this->m_stor = forward(xmod); + this->m_stor = forward(xmod); return *this; } diff --git a/asteria/runtime/runtime_error.hpp b/asteria/runtime/runtime_error.hpp index 77885ffcf..9f051db6a 100644 --- a/asteria/runtime/runtime_error.hpp +++ b/asteria/runtime/runtime_error.hpp @@ -32,10 +32,10 @@ class Runtime_Error ::rocket::tinyfmt_str m_fmt; // human-readable message public: - template - Runtime_Error(Uxtc_throw, XValT&& xval, const Source_Location& xsloc) + template + Runtime_Error(Uxtc_throw, xValueT&& xval, const Source_Location& xsloc) : - m_value(forward(xval)) + m_value(forward(xval)) { this->do_backtrace(); this->do_insert_frame(frame_type_throw, &xsloc, this->m_value); diff --git a/asteria/runtime/variable.hpp b/asteria/runtime/variable.hpp index b9f26ae4e..203eb249c 100644 --- a/asteria/runtime/variable.hpp +++ b/asteria/runtime/variable.hpp @@ -40,12 +40,12 @@ class Variable mut_value() { return this->m_value; } - template::value)> + template::value)> void - initialize(XValT&& xval) + initialize(xValueT&& xval) { - this->m_value = forward(xval); + this->m_value = forward(xval); this->m_init = true; } diff --git a/asteria/value.hpp b/asteria/value.hpp index 906633978..f2ead9638 100644 --- a/asteria/value.hpp +++ b/asteria/value.hpp @@ -32,34 +32,34 @@ class Value m_bytes() { } - template::direct_init::value)> - Value(XValT&& xval) + template::direct_init::value)> + Value(xValueT&& xval) noexcept(::std::is_nothrow_constructible::via_type&&>::value) + typename details_value::Valuable::via_type&&>::value) : - m_stor(typename details_value::Valuable::via_type(forward(xval))) + m_stor(typename details_value::Valuable::via_type(forward(xval))) { } - template::direct_init::value)> - Value(XValT&& xval) + template::direct_init::value)> + Value(xValueT&& xval) noexcept(::std::is_nothrow_assignable::via_type&&>::value) + typename details_value::Valuable::via_type&&>::value) : m_bytes() { - details_value::Valuable::assign(this->m_stor, forward(xval)); + details_value::Valuable::assign(this->m_stor, forward(xval)); } - template::via_type)> + template::via_type)> Value& - operator=(XValT&& xval) & + operator=(xValueT&& xval) & noexcept(::std::is_nothrow_assignable::via_type&&>::value) + typename details_value::Valuable::via_type&&>::value) { - details_value::Valuable::assign(this->m_stor, forward(xval)); + details_value::Valuable::assign(this->m_stor, forward(xval)); return *this; }