-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathzmpl.hpp
More file actions
51 lines (40 loc) · 1.56 KB
/
zmpl.hpp
File metadata and controls
51 lines (40 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/***************************************************************************
* Copyright (c) Johan Mabille, Sylvain Corlay and Wolf Vollprecht *
* Copyright (c) QuantStack *
* *
* Distributed under the terms of the BSD 3-Clause License. *
* *
* The full license is in the file LICENSE, distributed with this software. *
****************************************************************************/
#ifndef XTENSOR_ZMPL_TYPES_HPP
#define XTENSOR_ZMPL_TYPES_HPP
#include <type_traits>
#include "xtensor/xexpression.hpp"
namespace xt
{
class zarray;
class zarray_expression_tag;
namespace detail
{
template<class T>
struct is_zarray : public std::false_type
{
};
template<>
struct is_zarray<zarray> : public std::true_type
{
};
template<class E>
using enable_zarray_t = std::enable_if_t<is_zarray<E>::value>;
template<class E>
using has_zexpression_tag = std::is_same<extension::get_expression_tag_t<std::decay_t<E>>, zarray_expression_tag>;
template<class E>
using enable_zexpressions_t = std::enable_if_t<has_zexpression_tag<E>::value>;
template<class E>
using disable_zarray_enable_zexpressions_t = std::enable_if_t<
!is_zarray<E>::value &&
has_zexpression_tag<E>::value
>;
}
}
#endif