mgcpp
A C++ Math Library Based on CUDA
shape_type.hpp
Go to the documentation of this file.
1 #ifndef SHAPE_TYPE_HPP
2 #define SHAPE_TYPE_HPP
3 
4 #include <mgcpp/global/shape.hpp>
5 #include <tuple>
6 #include <type_traits>
7 
8 namespace mgcpp {
9 
10 template <typename T>
11 struct has_shape {
12  private:
13  typedef char one;
14  typedef struct {
15  char array[2];
16  } two;
17 
18  template <typename C>
19  static one test(typename C::shape_type*);
20  template <typename C>
21  static two test(...);
22 
23  public:
24  static const bool value = sizeof(test<T>(0)) == sizeof(one);
25 };
26 
27 } // namespace mgcpp
28 #endif // SHAPE_TYPE_HPP
Definition: adapter_base.hpp:12
static const bool value
Definition: shape_type.hpp:24
Definition: shape_type.hpp:11