mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2025-12-06 16:57:04 +08:00
replace the deprecated is_pod_v with is_trivial_v
is_pod_v was deprecated in C++20, is_pod_v can be replaced with is_trivial_v && is_standard_layout_v. I don't see any benefit from is_standard_layout_v, but I could have missed something.
This commit is contained in:
parent
cf7821cb1e
commit
1302e28e32
@ -36,14 +36,14 @@ namespace chaiscript
|
|||||||
struct Handle_Return
|
struct Handle_Return
|
||||||
{
|
{
|
||||||
template<typename T,
|
template<typename T,
|
||||||
typename = std::enable_if_t<std::is_pod_v<std::decay_t<T>>>>
|
typename = typename std::enable_if_t<std::is_trivial_v<typename std::decay_t<T>>>>
|
||||||
static Boxed_Value handle(T r)
|
static Boxed_Value handle(T r)
|
||||||
{
|
{
|
||||||
return Boxed_Value(std::move(r), true);
|
return Boxed_Value(std::move(r), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T,
|
template<typename T,
|
||||||
typename = std::enable_if_t<!std::is_pod_v<std::decay_t<T>>>>
|
typename = typename std::enable_if_t<!(std::is_trivial_v<typename std::decay_t<T>>)>>
|
||||||
static Boxed_Value handle(T &&r)
|
static Boxed_Value handle(T &&r)
|
||||||
{
|
{
|
||||||
return Boxed_Value(std::make_shared<T>(std::forward<T>(r)), true);
|
return Boxed_Value(std::make_shared<T>(std::forward<T>(r)), true);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user