piranha  0.10
is_cf.hpp
1 /* Copyright 2009-2017 Francesco Biscani (bluescarni@gmail.com)
2 
3 This file is part of the Piranha library.
4 
5 The Piranha library is free software; you can redistribute it and/or modify
6 it under the terms of either:
7 
8  * the GNU Lesser General Public License as published by the Free
9  Software Foundation; either version 3 of the License, or (at your
10  option) any later version.
11 
12 or
13 
14  * the GNU General Public License as published by the Free Software
15  Foundation; either version 3 of the License, or (at your option) any
16  later version.
17 
18 or both in parallel, as here.
19 
20 The Piranha library is distributed in the hope that it will be useful, but
21 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 for more details.
24 
25 You should have received copies of the GNU General Public License and the
26 GNU Lesser General Public License along with the Piranha library. If not,
27 see https://www.gnu.org/licenses/. */
28 
29 #ifndef PIRANHA_IS_CF_HPP
30 #define PIRANHA_IS_CF_HPP
31 
32 #include <type_traits>
33 
34 #include <piranha/math.hpp>
35 #include <piranha/print_coefficient.hpp>
36 #include <piranha/print_tex_coefficient.hpp>
37 #include <piranha/type_traits.hpp>
38 
39 namespace piranha
40 {
41 
43 
54 template <typename T>
55 class is_cf
56 {
57  static const bool implementation_defined
61  && std::is_constructible<T, int>::value;
62 
63 public:
65  static const bool value = implementation_defined;
66 };
67 
68 template <typename T>
69 const bool is_cf<T>::value;
70 }
71 
72 #endif
Subtractable type trait.
Equality-comparable type trait.
Type trait to detect coefficient types.
Definition: is_cf.hpp:55
In-place addable type trait.
Type trait for classes implementing piranha::print_tex_coefficient.
Type trait to detect the presence of the piranha::math::negate function.
Definition: math.hpp:1070
Type trait to detect the presence of the piranha::math::is_zero() function.
Definition: math.hpp:1049
Type trait for classes implementing piranha::print_coefficient.
In-place subtractable type trait.
static const bool value
Value of the type trait.
Definition: is_cf.hpp:65
Root piranha namespace.
Definition: array_key.hpp:52
Type traits.
Type trait for well-behaved container elements.
Addable type trait.