33#if __cplusplus >= 201703L
34# include <string_view>
39#define TIMEMORY_IMPL_IS_CONCEPT(CONCEPT) \
42 template <typename Tp> \
46 template <typename, typename = std::true_type> \
47 struct have : std::false_type \
49 template <typename U> \
50 struct have<U, typename std::is_base_of<typename U::CONCEPT, U>::type> \
53 template <typename U> \
54 struct have<U, typename std::is_base_of<typename U::CONCEPT##_type, U>::type> \
59 using type = typename is_##CONCEPT::template have< \
60 typename std::remove_cv<Tp>::type>::type; \
61 static constexpr bool value = \
62 is_##CONCEPT::template have<typename std::remove_cv<Tp>::type>::value; \
74class OutputArchiveBase;
75class InputArchiveBase;
84using true_type = std::true_type;
85using false_type = std::false_type;
102template <
typename Tp>
105template <
typename Tp>
111template <
typename Tp>
117template <
typename Tp>
118using anonymous_t =
typename anonymous<Tp>::type;
123template <
size_t Idx,
typename Tag>
126template <
size_t Nt,
typename ComponentsT,
typename DifferentiatorT = anonymous_t<
void>>
129template <
typename... Types>
136template <
typename... Types>
137class lightweight_tuple;
151template <
template <
typename...>
class Tuple>
161template <
template <
typename...>
class Tuple>
177template <
template <
typename...>
class Tuple>
200template <
typename... Types>
224template <
typename Tp>
229 template <
typename,
typename = std::true_type>
230 struct have : std::false_type
234 template <
typename U>
240 template <
typename U>
241 static constexpr decltype(U::is_component,
bool{}) test(
int)
243 return U::is_component;
248 template <
typename Up>
249 static constexpr bool test(
long)
252 is_component::template have<std::remove_cv_t<Tp>>
::value;
256 static constexpr bool value = test<Tp>(
int{});
257 using type = std::conditional_t<value, true_type, false_type>;
393#if __cplusplus >= 201703L
419template <
typename Tp>
424 template <
typename,
typename = std::true_type>
425 struct have : std::false_type
429 template <
typename U>
436 is_output_archive::template have<std::remove_cv_t<Tp>>
::value;
437 using type = std::conditional_t<value, true_type, false_type>;
444template <
typename Tp>
449 template <
typename,
typename = std::true_type>
450 struct have : std::false_type
454 template <
typename U>
455 struct have<U,
typename std::is_base_of<input_archive_base, U>
::type> : std::true_type
460 is_input_archive::template have<std::remove_cv_t<Tp>>
::value;
461 using type = std::conditional_t<value, true_type, false_type>;
468template <
typename Tp>
473 using type = std::conditional_t<value, true_type, false_type>;
486template <
typename Lhs,
typename Rhs>
490 (std::is_same<Lhs, Rhs>::value ||
491 (std::is_integral<Lhs>::value && std::is_integral<Rhs>::value) ||
492 (std::is_floating_point<Lhs>::value && std::is_floating_point<Rhs>::value));
505 using type =
typename T::tuple_type;
515 using type =
typename T::auto_type;
526 using type =
typename T::component_type;
560#if !defined(TIMEMORY_CONCEPT_ALIAS)
561# define TIMEMORY_CONCEPT_ALIAS(ALIAS, TYPE) \
566 template <typename T> \
567 using ALIAS = typename TYPE<T>::type; \
586#define TIMEMORY_DEFINE_CONCRETE_CONCEPT(CONCEPT, SPECIALIZED_TYPE, VALUE) \
592 struct CONCEPT<SPECIALIZED_TYPE> : VALUE \
599#define TIMEMORY_DEFINE_TEMPLATE_CONCEPT(CONCEPT, SPECIALIZED_TYPE, VALUE, TYPE) \
605 struct CONCEPT<SPECIALIZED_TYPE<T>> : VALUE \
612#define TIMEMORY_DEFINE_VARIADIC_CONCEPT(CONCEPT, SPECIALIZED_TYPE, VALUE, TYPE) \
617 template <TYPE... T> \
618 struct CONCEPT<SPECIALIZED_TYPE<T...>> : VALUE \
625#define TIMEMORY_DEFINE_CONCRETE_CONCEPT_TYPE(CONCEPT, SPECIALIZED_TYPE, ...) \
631 struct CONCEPT<SPECIALIZED_TYPE> \
633 using type = __VA_ARGS__; \
640#define TIMEMORY_DEFINE_TEMPLATE_CONCEPT_TYPE(CONCEPT, SPECIALIZED_TYPE, TYPE, ...) \
646 struct CONCEPT<SPECIALIZED_TYPE<T>> \
648 using type = __VA_ARGS__; \
655#define TIMEMORY_DEFINE_VARIADIC_CONCEPT_TYPE(CONCEPT, SPECIALIZED_TYPE, TYPE, ...) \
660 template <TYPE... T> \
661 struct CONCEPT<SPECIALIZED_TYPE<T...>> \
663 using type = __VA_ARGS__; \
This is a variadic component wrapper which provides the least amount of runtime and compilation overh...
#define TIMEMORY_CONCEPT_ALIAS(ALIAS, TYPE)
#define TIMEMORY_IMPL_IS_CONCEPT(CONCEPT)
typename is_stack_wrapper< T >::type is_stack_wrapper_t
typename is_variadic< T >::type is_variadic_t
typename T::tuple_type type
typename auto_type< T >::type auto_type_t
cereal::detail::InputArchiveBase input_archive_base
typename tuple_type< T >::type tuple_type_t
cereal::detail::OutputArchiveBase output_archive_base
typename is_heap_wrapper< T >::type is_heap_wrapper_t
typename is_empty< T >::type is_empty_t
typename T::component_type type
typename is_wrapper< T >::type is_wrapper_t
typename T::auto_type type
typename component_type< T >::type component_type_t
This concept is used to express how to convert a component bundler into another component bundler whi...
This concept is used to express how to convert a given type into a std::tuple, e.g....
This concept is used to express how to convert a component bundler which automatically starts upon co...
void audit(TupleT< Tp... > &obj, Args &&... args)
typename concepts::is_heap_wrapper< T >::type is_heap_wrapper_t
typename concepts::is_empty< T >::type is_empty_t
typename concepts::is_stack_wrapper< T >::type is_stack_wrapper_t
typename concepts::is_wrapper< T >::type is_wrapper_t
typename concepts::is_variadic< T >::type is_variadic_t
Used by component audit member function to designate the parameters being passed are incoming (e....
Used by component audit member function to designate the parameters being passed are outgoing (e....
determines if a variadic wrapper contains a gotcha component
concept that specifies that a type is a user_bundle type
This concept designates that is safe to perform a static_cast<Lhs>(rhs) where needed....
static constexpr bool value
concept that specifies that a type is a serialization archive (input or output)
std::conditional_t< value, true_type, false_type > type
static constexpr bool value
concept that specifies that a type is a component. Components are used to perform some measurement,...
std::conditional_t< value, true_type, false_type > type
static constexpr bool value
concept that specifies that a variadic type is empty
typename is_empty ::template have< typename std::remove_cv< Tp >::type >::type type
concept that specifies that a type is a timemory variadic wrapper and components are heap-allocated
typename is_heap_wrapper ::template have< typename std::remove_cv< Tp >::type >::type type
concept that specifies that a type is not a useful type
concept that specifies that a type is an output serialization archive
std::conditional_t< value, true_type, false_type > type
static constexpr bool value
concept that specifies that a type is not necessarily marked as not available but is still a dummy ty...
concept that specifies that a type is a timemory variadic wrapper and components are stack-allocated
typename is_stack_wrapper ::template have< typename std::remove_cv< Tp >::type >::type type
concept that specifies that a component type wraps external functions
concept that specifies that a type is a generic variadic wrapper
typename is_variadic ::template have< typename std::remove_cv< Tp >::type >::type type
concept that specifies that a type is a timemory variadic wrapper
typename is_wrapper ::template have< typename std::remove_cv< Tp >::type >::type type
this is a placeholder type for optional type-traits. It is used as the default type for the type-trai...
A generic class for statistical accumulation. It uses the timemory math overloads to enable statistic...
trait that designates the type is a timemory component
typename typename typename