|
|
|
@ -320,6 +320,20 @@ struct file_event_handlers
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
namespace details {
|
|
|
|
|
|
|
|
|
|
// to avoid useless casts (see https://github.com/nlohmann/json/issues/2893#issuecomment-889152324)
|
|
|
|
|
template<typename T, typename U, std::enable_if_t<!std::is_same<T, U>::value, int> = 0>
|
|
|
|
|
constexpr T conditional_static_cast(U value)
|
|
|
|
|
{
|
|
|
|
|
return static_cast<T>(value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<typename T, typename U, std::enable_if_t<std::is_same<T, U>::value, int> = 0>
|
|
|
|
|
constexpr T conditional_static_cast(U value)
|
|
|
|
|
{
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// make_unique support for pre c++14
|
|
|
|
|
|
|
|
|
|
#if __cplusplus >= 201402L // C++14 and beyond
|
|
|
|
|