replace typedef with using

This commit is contained in:
Bernd Amend 2021-05-22 14:04:04 +02:00
parent 684522a8b7
commit 2b3bddb02d
7 changed files with 12 additions and 14 deletions

View File

@ -81,23 +81,23 @@ namespace chaiscript {
template<typename Ret, typename ... Params> template<typename Ret, typename ... Params>
struct Function_Signature<Ret (Params...)> struct Function_Signature<Ret (Params...)>
{ {
typedef Ret Return_Type; using Return_Type = Ret;
typedef Ret (Signature)(Params...); using Signature = Ret ()(Params...);
}; };
template<typename Ret, typename T, typename ... Params> template<typename Ret, typename T, typename ... Params>
struct Function_Signature<Ret (T::*)(Params...) const> struct Function_Signature<Ret (T::*)(Params...) const>
{ {
typedef Ret Return_Type; using Return_Type = Ret;
typedef Ret (Signature)(Params...); using Signature = Ret ()(Params...);
}; };
template<typename T> template<typename T>
struct Callable_Traits struct Callable_Traits
{ {
typedef typename Function_Signature<decltype(&T::operator())>::Signature Signature; using Signature = typename Function_Signature<decltype(&T::operator())>::Signature;
typedef typename Function_Signature<decltype(&T::operator())>::Return_Type Return_Type; using Return_Type = typename Function_Signature<decltype(&T::operator())>::Return_Type;
}; };
} }
} }

View File

@ -150,8 +150,6 @@ namespace chaiscript
template<typename T> template<typename T>
struct Get_Type_Info<std::shared_ptr<T> > struct Get_Type_Info<std::shared_ptr<T> >
{ {
// typedef T type;
constexpr static Type_Info get() noexcept constexpr static Type_Info get() noexcept
{ {
return Type_Info(std::is_const<T>::value, std::is_reference<T>::value, std::is_pointer<T>::value, return Type_Info(std::is_const<T>::value, std::is_reference<T>::value, std::is_pointer<T>::value,

View File

@ -60,7 +60,7 @@ namespace chaiscript
namespace detail namespace detail
{ {
typedef std::shared_ptr<Loadable_Module> Loadable_Module_Ptr; using Loadable_Module_Ptr = std::shared_ptr<Loadable_Module>;
} }

View File

@ -461,8 +461,8 @@ namespace chaiscript {
} }
}; };
typedef Optimizer<optimizer::Partial_Fold, optimizer::Unused_Return, optimizer::Constant_Fold, using Optimizer_Default = Optimizer<optimizer::Partial_Fold, optimizer::Unused_Return, optimizer::Constant_Fold,
optimizer::If, optimizer::Return, optimizer::Dead_Code, optimizer::Block, optimizer::For_Loop, optimizer::Assign_Decl> Optimizer_Default; optimizer::If, optimizer::Return, optimizer::Dead_Code, optimizer::Block, optimizer::For_Loop, optimizer::Assign_Decl>;
} }
} }

View File

@ -37,7 +37,7 @@ namespace chaiscript {
} }
}; };
typedef Tracer<Noop_Tracer_Detail> Noop_Tracer; using Noop_Tracer = Tracer<Noop_Tracer_Detail>;
} }
} }

View File

@ -52,7 +52,7 @@ namespace chaiscript
static std::string get_error_message(DWORD t_err) static std::string get_error_message(DWORD t_err)
{ {
typedef LPTSTR StringType; using StringType = LPTSTR;
#if defined(_UNICODE) || defined(UNICODE) #if defined(_UNICODE) || defined(UNICODE)
std::wstring retval = L"Unknown Error"; std::wstring retval = L"Unknown Error";

View File

@ -1073,7 +1073,7 @@ struct Count_Tracer
TEST_CASE("Test count tracer") TEST_CASE("Test count tracer")
{ {
typedef chaiscript::parser::ChaiScript_Parser< chaiscript::eval::Tracer<Count_Tracer>, chaiscript::optimizer::Optimizer_Default > Parser_Type; using Parser_Type = chaiscript::parser::ChaiScript_Parser< chaiscript::eval::Tracer<Count_Tracer>, chaiscript::optimizer::Optimizer_Default >;
chaiscript::ChaiScript_Basic chai(chaiscript::Std_Lib::library(), chaiscript::ChaiScript_Basic chai(chaiscript::Std_Lib::library(),
std::make_unique<Parser_Type>()); std::make_unique<Parser_Type>());