TVM  0.9.4
meta.h File Reference
#include <type_traits>
Include dependency graph for meta.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tvm::internal::is_base< Base >
 
class  tvm::internal::always_true< T >
 
class  tvm::internal::always_false< T >
 

Namespaces

 tvm
 
 tvm::internal
 

Macros

#define TVM_CREATE_HAS_MEMBER_TYPE_TRAIT_FOR(Type)
 

Typedefs

template<typename T , typename... Base>
using tvm::internal::enable_for_t = std::enable_if_t<(...||(std::is_same_v< T, Base >||derives_from< T, Base >())), int >
 
template<typename T , template< typename... > class... Base>
using tvm::internal::enable_for_templated_t = std::enable_if_t<(...||derives_from< T, Base >()), int >
 
template<typename T , template< typename... > class... Base>
using tvm::internal::disable_for_templated_t = std::enable_if_t<!(...||derives_from< T, Base >()), int >
 
template<typename T , bool c>
using tvm::internal::const_if = std::conditional< c, const T, T >
 
template<typename T , bool c>
using tvm::internal::const_if_t = typename const_if< T, c >::type
 

Functions

template<typename T , template< typename... > class Base>
constexpr bool tvm::internal::derives_from ()
 

Macro Definition Documentation

◆ TVM_CREATE_HAS_MEMBER_TYPE_TRAIT_FOR

#define TVM_CREATE_HAS_MEMBER_TYPE_TRAIT_FOR (   Type)
Value:
namespace tvm::internal \
{ \
struct has_type_##Type##_helper \
{ \
template<typename T> \
std::false_type has(...); \
\
template<typename T> \
std::true_type has(typename T::Type *); \
}; \
\
template<typename T> \
using has_public_member_type_##Type = decltype(has_type_##Type##_helper{}.has<T>(nullptr)); \
}
Type
Definition: enums.h:15
Definition: CallbackManager.h:12

Copyright 2017-2020 CNRS-AIST JRL and CNRS-UM LIRMM For a name XXX, this creates a templated struct has_public_member_type_XXX in the namespace tvm::internal such that has_public_member_type_XXX<T>::value is true if T::XXX is a public, valid expression and refers to a type, and false otherwise.