mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
36 lines
733 B
C++
36 lines
733 B
C++
![]() |
#ifndef OPENMW_COMPONENTS_ESM_TYPETRAITS
|
||
|
#define OPENMW_COMPONENTS_ESM_TYPETRAITS
|
||
|
|
||
|
#include <type_traits>
|
||
|
|
||
|
namespace ESM
|
||
|
{
|
||
|
template <class T, class = std::void_t<>>
|
||
|
struct HasId : std::false_type
|
||
|
{
|
||
|
};
|
||
|
|
||
|
template <class T>
|
||
|
struct HasId<T, std::void_t<decltype(T::mId)>> : std::true_type
|
||
|
{
|
||
|
};
|
||
|
|
||
|
template <class T>
|
||
|
inline constexpr bool hasId = HasId<T>::value;
|
||
|
|
||
|
template <class T, class = std::void_t<>>
|
||
|
struct HasModel : std::false_type
|
||
|
{
|
||
|
};
|
||
|
|
||
|
template <class T>
|
||
|
struct HasModel<T, std::void_t<decltype(T::mModel)>> : std::true_type
|
||
|
{
|
||
|
};
|
||
|
|
||
|
template <class T>
|
||
|
inline constexpr bool hasModel = HasModel<T>::value;
|
||
|
}
|
||
|
|
||
|
#endif // OPENMW_COMPONENTS_ESM_TYPETRAITS
|