make indent with 4 caracters instead of 8

This commit is contained in:
ado
2020-12-26 00:46:42 +01:00
parent 16f4648cb3
commit e406253694
9 changed files with 1688 additions and 1746 deletions

View File

@@ -12,13 +12,13 @@ namespace ss {
template <size_t N, typename T, typename... Ts>
struct decayed_arg_n {
static_assert(N - 1 != sizeof...(Ts), "index out of range");
using type = typename decayed_arg_n<N - 1, Ts...>::type;
static_assert(N - 1 != sizeof...(Ts), "index out of range");
using type = typename decayed_arg_n<N - 1, Ts...>::type;
};
template <typename T, typename... Ts>
struct decayed_arg_n<0, T, Ts...> {
using type = std::decay_t<T>;
using type = std::decay_t<T>;
};
template <typename T>
@@ -26,12 +26,12 @@ struct function_traits;
template <typename R, typename C, typename Arg>
struct function_traits<std::function<R(C&, const Arg&) const>> {
using arg_type = Arg;
using arg_type = Arg;
};
template <typename R, typename... Ts>
struct function_traits<R(Ts...)> {
using arg0 = typename decayed_arg_n<0, Ts...>::type;
using arg0 = typename decayed_arg_n<0, Ts...>::type;
};
template <typename R, typename... Ts>
@@ -54,7 +54,7 @@ struct member_wrapper;
template <typename R, typename T>
struct member_wrapper<R T::*> {
using arg_type = typename function_traits<R>::arg0;
using arg_type = typename function_traits<R>::arg0;
};
////////////////
@@ -62,19 +62,19 @@ struct member_wrapper<R T::*> {
////////////////
#define INIT_HAS_METHOD(method) \
template <typename T> \
class has_m_##method { \
template <typename C> \
static std::true_type test(decltype(&C::method)); \
template <typename T> \
class has_m_##method { \
template <typename C> \
static std::true_type test(decltype(&C::method)); \
\
template <typename C> \
static std::false_type test(...); \
template <typename C> \
static std::false_type test(...); \
\
public: \
constexpr static bool value = decltype(test<T>(0))::value; \
}; \
public: \
constexpr static bool value = decltype(test<T>(0))::value; \
}; \
\
template <typename T> \
constexpr bool has_m_##method##_t = has_m_##method<T>::value;
template <typename T> \
constexpr bool has_m_##method##_t = has_m_##method<T>::value;
} /* trait */