mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2025-12-06 16:57:04 +08:00
replace typedef with using
This commit is contained in:
parent
684522a8b7
commit
2b3bddb02d
@ -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;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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,
|
||||||
|
|||||||
@ -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>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -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>;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,7 +37,7 @@ namespace chaiscript {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef Tracer<Noop_Tracer_Detail> Noop_Tracer;
|
using Noop_Tracer = Tracer<Noop_Tracer_Detail>;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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";
|
||||||
|
|||||||
@ -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>());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user