7 template<
typename Container>
8 using value_type =
typename Container::value_type;
10 template<
typename Iterator>
11 using value_type_i =
typename std::iterator_traits<Iterator>::value_type;
13 template<
typename Container>
14 using iterator =
typename Container::iterator;
16 template<
typename Container>
17 using const_iterator =
typename Container::const_iterator;
20 template<
typename T>
struct sqrt_type {
using type = double; };
21 template<>
struct sqrt_type<float> {
using type = float; };
22 template<>
struct sqrt_type<long double> {
using type =
long double; };
23 template<
typename T>
using sqrt_type_t =
typename sqrt_type<T>::type;
25 template<
typename Container>
26 using sqrt_value_type = sqrt_type_t<value_type<Container>>;
28 template<
typename Iterator>
29 using sqrt_value_type_i = sqrt_type_t<value_type_i<Iterator>>;
34 #if !_MSC_VER || __clang__ 36 template<
typename A,
typename B,
typename C>
37 using check_sum = decltype(C{ A{} + B{} })*;
39 template<
typename A,
typename B,
typename C>
40 using check_difference = decltype(C{ A{} - B{} })*;
42 template<
typename A,
typename B,
typename C>
43 using check_product = decltype(C{ A{} * B{} })*;
45 template<
typename A,
typename B,
typename C>
46 using check_ratio = decltype(C{ A{} / B{} })*;
48 #else // Fallback for MSVC without Clang. 50 template<
typename A,
typename B,
typename C = B>
51 using enable_if_same =
typename std::enable_if<
52 std::is_same<A, B>::value && std::is_same<B, C>::value,
void*>::type;
54 template<
typename A,
typename B,
typename C>
55 using check_sum = enable_if_same<A, B, C>;
57 template<
typename A,
typename B,
typename C>
58 using check_difference = enable_if_same<A, B, C>;
60 template<
typename A,
typename B,
typename C>
61 using check_product = enable_if_same<A, B, C>;
63 template<
typename A,
typename B,
typename C>
64 using check_ratio = enable_if_same<A, B, C>;
Definition: traits.hpp:20