mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2026-01-01 03:12:23 +08:00
Make constructors return values, not shared_ptr
This commit is contained in:
parent
b810e4f7d9
commit
ac7af60d76
@ -17,8 +17,8 @@ namespace chaiscript {
|
||||
struct Constructor
|
||||
{
|
||||
template<typename ... Inner>
|
||||
std::shared_ptr<Class> operator()(Inner&& ... inner) const {
|
||||
return std::make_shared<Class>(std::forward<Inner>(inner)...);
|
||||
constexpr Class operator()(Inner&& ... inner) const {
|
||||
return Class(std::forward<Inner>(inner)...);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -1363,8 +1363,8 @@ namespace chaiscript
|
||||
const auto lhssize = lhsparamtypes.size();
|
||||
const auto rhssize = rhsparamtypes.size();
|
||||
|
||||
static const auto boxed_type = user_type<Boxed_Value>();
|
||||
static const auto boxed_pod_type = user_type<Boxed_Number>();
|
||||
constexpr const auto boxed_type = user_type<Boxed_Value>();
|
||||
constexpr const auto boxed_pod_type = user_type<Boxed_Number>();
|
||||
|
||||
for (size_t i = 1; i < lhssize && i < rhssize; ++i)
|
||||
{
|
||||
|
||||
@ -26,7 +26,7 @@ namespace chaiscript
|
||||
auto call = dispatch::detail::Constructor<Class, Params...>();
|
||||
|
||||
return Proxy_Function(
|
||||
chaiscript::make_shared<dispatch::Proxy_Function_Base, dispatch::Proxy_Function_Callable_Impl<std::shared_ptr<Class> (Params...), decltype(call)>>(call));
|
||||
chaiscript::make_shared<dispatch::Proxy_Function_Base, dispatch::Proxy_Function_Callable_Impl<Class (Params...), decltype(call)>>(call));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user