mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
19 lines
397 B
C++
19 lines
397 B
C++
#ifndef OPENMW_COMPONENTS_MISC_TYPETRAITS_H
|
|
#define OPENMW_COMPONENTS_MISC_TYPETRAITS_H
|
|
|
|
#include <optional>
|
|
#include <type_traits>
|
|
|
|
namespace Misc
|
|
{
|
|
template <class T>
|
|
struct IsOptional : std::false_type {};
|
|
|
|
template <class T>
|
|
struct IsOptional<std::optional<T>> : std::true_type {};
|
|
|
|
template <class T>
|
|
inline constexpr bool isOptional = IsOptional<T>::value;
|
|
}
|
|
|
|
#endif
|