Skip to content

Commit

Permalink
*: Rename template parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
lhmouse committed Feb 7, 2024
1 parent 3a7be39 commit b972856
Show file tree
Hide file tree
Showing 12 changed files with 177 additions and 177 deletions.
8 changes: 4 additions & 4 deletions asteria/compiler/compiler_error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ class Compiler_Error
this->do_compose_message();
}

template<typename... ParamsT>
template<typename... xParams>
Compiler_Error(Uxtc_format, Compiler_Status xstat, const Source_Location& xsloc,
const char* templ, const ParamsT&... params)
const char* templ, const xParams&... params)
:
m_status(xstat), m_sloc(xsloc)
{
Expand All @@ -42,9 +42,9 @@ class Compiler_Error
this->do_compose_message();
}

template<typename... ParamsT>
template<typename... xParams>
Compiler_Error(Uxtc_status_format, Compiler_Status xstat, const Source_Location& xsloc,
const char* templ, const ParamsT&... params)
const char* templ, const xParams&... params)
:
m_status(xstat), m_sloc(xsloc)
{
Expand Down
18 changes: 9 additions & 9 deletions asteria/compiler/token_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,25 +366,25 @@ do_accept_numeric_literal(cow_vector<Token>& tokens, Text_Reader& reader,

struct Prefix_Comparator
{
template<typename ElementT>
template<typename xElement>
bool
operator()(const ElementT& lhs, const ElementT& rhs) const noexcept
operator()(const xElement& lhs, const xElement& rhs) const noexcept
{ return ::memcmp(lhs.str, rhs.str, sizeof(lhs.str)) < 0; }

template<typename ElementT>
template<typename xElement>
bool
operator()(char lhs, const ElementT& rhs) const noexcept
operator()(char lhs, const xElement& rhs) const noexcept
{ return (uint8_t) lhs < (uint8_t) rhs.str[0]; }

template<typename ElementT>
template<typename xElement>
bool
operator()(const ElementT& lhs, char rhs) const noexcept
operator()(const xElement& lhs, char rhs) const noexcept
{ return (uint8_t) lhs.str[0] < (uint8_t) rhs; }
};

template<typename ElementT, size_t N>
pair<ElementT*, ElementT*>
do_prefix_range(ElementT (&table)[N], char ch)
template<typename xElement, size_t N>
pair<xElement*, xElement*>
do_prefix_range(xElement (&table)[N], char ch)
{
static constexpr Prefix_Comparator comp;
#ifdef ROCKET_DEBUG
Expand Down
100 changes: 50 additions & 50 deletions asteria/details/value.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace details_value {
// The main templte is undefined and is SFINAE-friendly.
// A member type alias `via_type` shall be provided, which shall designate
// one of the `V_*` candidates.
template<typename ValT, typename = void>
template<typename xVal, typename = void>
struct Valuable_impl;

template<>
Expand All @@ -20,10 +20,10 @@ struct Valuable_impl<nullopt_t>
using direct_init = ::std::true_type;
using via_type = V_null;

template<typename StorT>
template<typename xStor>
static
void
assign(StorT& stor, nullopt_t)
assign(xStor& stor, nullopt_t)
{
stor = V_null();
}
Expand All @@ -35,64 +35,64 @@ struct Valuable_impl<bool>
using direct_init = ::std::true_type;
using via_type = V_boolean;

template<typename StorT, typename xValueT>
template<typename xStor, typename xValueT>
static
void
assign(StorT& stor, xValueT&& xval)
assign(xStor& stor, xValueT&& xval)
{
stor = V_boolean(xval);
}
};

template<typename IntegerT>
struct Valuable_impl<IntegerT, typename ::std::enable_if<
::rocket::is_any_type_of<IntegerT,
template<typename xInteger>
struct Valuable_impl<xInteger, typename ::std::enable_if<
::rocket::is_any_type_of<xInteger,
signed char, short, int, long, long long>::value
>::type>
{
using direct_init = ::std::true_type;
using via_type = V_integer;

template<typename StorT, typename xValueT>
template<typename xStor, typename xValueT>
static
void
assign(StorT& stor, xValueT&& xval)
assign(xStor& stor, xValueT&& xval)
{
stor = V_integer(xval);
}
};

template<typename FloatT>
struct Valuable_impl<FloatT, typename ::std::enable_if<
::rocket::is_any_type_of<FloatT,
template<typename xFloat>
struct Valuable_impl<xFloat, typename ::std::enable_if<
::rocket::is_any_type_of<xFloat,
float, double>::value
>::type>
{
using direct_init = ::std::true_type;
using via_type = V_real;

template<typename StorT, typename xValueT>
template<typename xStor, typename xValueT>
static
void
assign(StorT& stor, xValueT&& xval)
assign(xStor& stor, xValueT&& xval)
{
stor = V_real(xval);
}
};

template<typename StringT>
struct Valuable_impl<StringT, typename ::std::enable_if<
::rocket::is_any_type_of<StringT,
template<typename xString>
struct Valuable_impl<xString, typename ::std::enable_if<
::rocket::is_any_type_of<xString,
cow_string::shallow_type, cow_string>::value
>::type>
{
using direct_init = ::std::true_type;
using via_type = V_string;

template<typename StorT, typename xValueT>
template<typename xStor, typename xValueT>
static
void
assign(StorT& stor, xValueT&& xval)
assign(xStor& stor, xValueT&& xval)
{
stor = V_string(forward<xValueT>(xval));
}
Expand All @@ -104,10 +104,10 @@ struct Valuable_impl<const char (*)[N]>
using direct_init = ::std::true_type;
using via_type = V_string;

template<typename StorT, typename xValueT>
template<typename xStor, typename xValueT>
static
void
assign(StorT& stor, xValueT&& xval)
assign(xStor& stor, xValueT&& xval)
{
stor = V_string(forward<xValueT>(xval));
}
Expand All @@ -119,10 +119,10 @@ struct Valuable_impl<cow_opaque>
using direct_init = ::std::false_type;
using via_type = V_opaque;

template<typename StorT, typename xValueT>
template<typename xStor, typename xValueT>
static
void
assign(StorT& stor, xValueT&& xval)
assign(xStor& stor, xValueT&& xval)
{
if(xval)
stor = V_opaque(forward<xValueT>(xval));
Expand All @@ -131,19 +131,19 @@ struct Valuable_impl<cow_opaque>
}
};

template<typename OpaqueT>
struct Valuable_impl<refcnt_ptr<OpaqueT>, typename ::std::enable_if<
::std::is_convertible<OpaqueT*,
template<typename xOpaque>
struct Valuable_impl<refcnt_ptr<xOpaque>, typename ::std::enable_if<
::std::is_convertible<xOpaque*,
Abstract_Opaque*>::value
>::type>
{
using direct_init = ::std::false_type;
using via_type = V_opaque;

template<typename StorT, typename xValueT>
template<typename xStor, typename xValueT>
static
void
assign(StorT& stor, xValueT&& xval)
assign(xStor& stor, xValueT&& xval)
{
if(xval)
stor = V_opaque(forward<xValueT>(xval));
Expand All @@ -158,10 +158,10 @@ struct Valuable_impl<cow_function>
using direct_init = ::std::false_type;
using via_type = V_function;

template<typename StorT, typename xValueT>
template<typename xStor, typename xValueT>
static
void
assign(StorT& stor, xValueT&& xval)
assign(xStor& stor, xValueT&& xval)
{
if(xval)
stor = V_function(forward<xValueT>(xval));
Expand All @@ -170,19 +170,19 @@ struct Valuable_impl<cow_function>
}
};

template<typename FunctionT>
struct Valuable_impl<refcnt_ptr<FunctionT>, typename ::std::enable_if<
::std::is_convertible<FunctionT*,
template<typename xFunction>
struct Valuable_impl<refcnt_ptr<xFunction>, typename ::std::enable_if<
::std::is_convertible<xFunction*,
const Abstract_Function*>::value
>::type>
{
using direct_init = ::std::false_type;
using via_type = V_function;

template<typename StorT, typename xValueT>
template<typename xStor, typename xValueT>
static
void
assign(StorT& stor, xValueT&& xval)
assign(xStor& stor, xValueT&& xval)
{
if(xval)
stor = V_function(forward<xValueT>(xval));
Expand All @@ -197,10 +197,10 @@ struct Valuable_impl<V_array>
using direct_init = ::std::true_type;
using via_type = V_array;

template<typename StorT, typename xValueT>
template<typename xStor, typename xValueT>
static
void
assign(StorT& stor, xValueT&& xval)
assign(xStor& stor, xValueT&& xval)
{
stor = V_array(forward<xValueT>(xval));
}
Expand All @@ -212,10 +212,10 @@ struct Valuable_impl<V_object>
using direct_init = ::std::true_type;
using via_type = V_object;

template<typename StorT, typename xValueT>
template<typename xStor, typename xValueT>
static
void
assign(StorT& stor, xValueT&& xval)
assign(xStor& stor, xValueT&& xval)
{
stor = V_object(forward<xValueT>(xval));
}
Expand All @@ -227,10 +227,10 @@ struct Valuable_impl<xValueT [N]>
using direct_init = ::std::false_type;
using via_type = V_array;

template<typename StorT, typename xArrT>
template<typename xStor, typename xArrT>
static
void
assign(StorT& stor, xArrT&& xarr)
assign(xStor& stor, xArrT&& xarr)
{
V_array arr;
arr.reserve(N);
Expand All @@ -242,9 +242,9 @@ struct Valuable_impl<xValueT [N]>
}
};

template<typename TupleT>
struct Valuable_impl<TupleT, typename ::std::conditional<
bool(::std::tuple_size<TupleT>::value), void, void
template<typename xTuple>
struct Valuable_impl<xTuple, typename ::std::conditional<
bool(::std::tuple_size<xTuple>::value), void, void
>::type>
{
using direct_init = ::std::false_type;
Expand All @@ -261,13 +261,13 @@ struct Valuable_impl<TupleT, typename ::std::conditional<
(void)dummy;
}

template<typename StorT, typename xTupT>
template<typename xStor, typename xTupT>
static
void
assign(StorT& stor, xTupT&& xtup)
assign(xStor& stor, xTupT&& xtup)
{
V_array arr;
constexpr size_t N = ::std::tuple_size<TupleT>::value;
constexpr size_t N = ::std::tuple_size<xTuple>::value;
arr.reserve(N);
unpack_tuple_aux(arr, ::std::make_index_sequence<N>(),
forward<xTupT>(xtup));
Expand All @@ -283,10 +283,10 @@ struct Valuable_impl<opt<xValueT>, typename ::std::conditional<
using direct_init = ::std::false_type;
using via_type = typename Valuable_impl<xValueT>::via_type;

template<typename StorT, typename xOptT>
template<typename xStor, typename xOptT>
static
void
assign(StorT& stor, xOptT&& xopt)
assign(xStor& stor, xOptT&& xopt)
{
if(xopt)
Valuable_impl<xValueT>::assign(stor,
Expand Down
Loading

0 comments on commit b972856

Please sign in to comment.