2#ifndef UTOPIA_CORE_TYPETRAITS_HH
3#define UTOPIA_CORE_TYPETRAITS_HH
17#include <boost/hana/ext/std/tuple.hpp>
18#include <boost/hana/for_each.hpp>
19#include <boost/hana/tuple.hpp>
39template <
typename T,
typename U = std::
void_t<> >
51template <
typename T >
64template <
typename T >
73template <
typename T >
88template <
typename T >
92 std::remove_cv_t< remove_pointer_t< std::remove_reference_t< T > > >;
96template <
typename T >
103template <
typename T >
111template <
typename...
Ts >
119template<
typename...
Ts>
139template <
typename T >
148template <
typename T,
typename = std::
void_t<> >
159template <
typename T >
165template <
typename T >
174template <
class T,
class U = std::
void_t<> >
180template <
typename T >
189template <
typename T >
192 is_iterable_v< remove_qualifier_t< T > > and
193 not is_string_v< remove_qualifier_t< T > >,
194 int > > > :
public std::true_type
209template <
typename T,
typename = std::
void_t<> >
222template <
typename T >
225 std::
void_t< std::enable_if_t< is_container_v< T >, int >,
226 typename T::key_type,
227 typename T::key_compare > > : std::true_type
232template <
typename T >
244template <
typename T,
typename = std::
void_t<> >
257template <
typename T >
260 std::
void_t< std::enable_if_t< is_container_v< T >, int >,
261 typename T::key_type,
262 typename T::value_type,
263 typename T::hasher > > : std::true_type
268template <
typename T >
279template <
typename T,
typename = std::
void_t<> >
291template <
typename T >
295 std::enable_if_t< not is_associative_container_v< T > and
296 not is_unordered_associative_container_v< T > and
298 int > > > : std::true_type
307template <
typename T >
315template <
typename T,
typename = std::
void_t<> >
325template <
typename T >
329 is_linear_container_v< T > and
330 std::is_convertible_v< typename std::iterator_traits<
331 typename T::iterator >::iterator_category,
332 std::random_access_iterator_tag > > > >
338template <
typename T >
347template <
typename T,
typename U = std::
void_t<> >
356template <
typename T >
363template <
typename T >
372template <
typename T,
typename U = std::
void_t<> >
381template <
typename T >
388template <
typename T >
396template <
typename T,
typename U = std::
void_t<> >
407template <
typename T >
410 std::
void_t< std::enable_if_t< has_edge_descriptor_v< T > and
411 has_vertex_descriptor_v< T >,
412 int > > > : std::true_type
417template <
typename T >
430template <
typename T >
432 : std::integral_constant<
434 std::numeric_limits< std::size_t >::max() >
442template <
typename T, std::
size_t N >
448template <
typename...
Ts >
450 : std::integral_constant< std::size_t, sizeof...(Ts) >
455template <
typename A,
typename B >
461template <
typename...
Ts >
463 : std::integral_constant< std::size_t, sizeof...(Ts) >
468template < arma::uword N, arma::uword M >
470 : std::integral_constant< std::size_t, N * M >
475template < arma::uword N, arma::uword M >
477 : std::integral_constant< std::size_t, N * M >
482template < arma::uword N, arma::uword M >
484 : std::integral_constant< std::size_t, N * M >
489template < arma::uword N, arma::uword M >
491 : std::integral_constant< std::size_t, N * M >
496template < arma::uword N, arma::uword M >
498 : std::integral_constant< std::size_t, N * M >
503template < arma::uword N, arma::uword M >
505 : std::integral_constant< std::size_t, N * M >
510template < arma::uword N >
512 : std::integral_constant< std::size_t, N >
517template < arma::uword N >
519 : std::integral_constant< std::size_t, N >
524template < arma::uword N >
526 : std::integral_constant< std::size_t, N >
531template < arma::uword N >
533 : std::integral_constant< std::size_t, N >
538template < arma::uword N >
540 : std::integral_constant< std::size_t, N >
545template < arma::uword N >
547 : std::integral_constant< std::size_t, N >
552template < arma::uword N >
554 : std::integral_constant< std::size_t, N >
559template < arma::uword N >
561 : std::integral_constant< std::size_t, N >
566template < arma::uword N >
568 : std::integral_constant< std::size_t, N >
573template < arma::uword N >
575 : std::integral_constant< std::size_t, N >
580template < arma::uword N >
582 : std::integral_constant< std::size_t, N >
587template < arma::uword N >
589 : std::integral_constant< std::size_t, N >
594template <
typename T >
606template <
typename T,
typename U = std::
void_t<> >
620template <
typename T >
624 std::enable_if_t< get_size_v< T > !=
625 std::numeric_limits< std::size_t >::max() and
626 is_container_v< T > >,
627 int > > : std::true_type
632template <
typename T >
643template <
typename T, std::
size_t s >
655template <
typename T >
668template <
typename T >
674template <
typename T >
683template <
typename T,
typename X = std::
void_t<> >
687 static constexpr bool value =
false;
696template <
typename T >
699 std::
void_t< std::enable_if_t< std::is_class_v< std::decay_t< T > >, T > > >
714 template <
typename U, U >
717 typedef char True[1];
718 typedef char False[2];
720 template <
typename S >
721 static constexpr True&
724 template <
typename S >
725 static constexpr False&
733template <
typename T >
static constexpr True & f(...)
static constexpr False & f(Check< void(Fallback::*)(), &S::operator()> *)
Check if a type T is callable, i.e., if it has.
Definition type_traits.hh:685
static constexpr bool value
Definition type_traits.hh:687
Container select_entities(const Manager &mngr, const DataIO::Config &sel_cfg)
Select entities according to parameters specified in a configuration.
Definition select.hh:213
constexpr bool has_vertex_descriptor_v
Shorthand for has_vertex_descriptor<T>::value.
Definition type_traits.hh:364
constexpr bool is_graph_v
Shorthand for is_graph<T>::value.
Definition type_traits.hh:418
constexpr bool is_associative_container_v
Shorthand for is_associative_container<T>::value.
Definition type_traits.hh:233
constexpr bool is_callable_v
Shorthand for is_callable<T>::value.
Definition type_traits.hh:734
constexpr bool is_random_access_container_v
shorthand for is_linear_container<T>::value
Definition type_traits.hh:339
constexpr bool is_container_v
Shorthand for 'is_container::value.
Definition type_traits.hh:181
constexpr std::size_t get_size_v
Definition type_traits.hh:595
typename remove_pointer< T >::type remove_pointer_t
Shorthand for 'typename remove_pointer<T>::type'.
Definition type_traits.hh:65
constexpr bool has_static_size_v
Shorthand for has_static_size::value.
Definition type_traits.hh:675
constexpr bool is_linear_container_v
Shorthand for is_linear_container<T>::value.
Definition type_traits.hh:308
constexpr bool has_edge_descriptor_v
shothand for has_edge_descriptor<T>::value
Definition type_traits.hh:389
constexpr bool is_unordered_associative_container_v
Shorthand for is_unordered_associative_container<T>::value.
Definition type_traits.hh:269
constexpr bool is_iterable_v
shorthand for is_iterable<T>::value
Definition type_traits.hh:166
typename remove_qualifier< T >::type remove_qualifier_t
Shorthand for 'typename remove_qualifier::value'.
Definition type_traits.hh:97
constexpr bool is_array_like_v
Shorthand for is_array_like<T>::value.
Definition type_traits.hh:633
constexpr bool is_string_v
Shorthand for 'is_string<T>::value'.
Definition type_traits.hh:140
Definition parallel.hh:235
Represent a type that does nothing and represents nothing, hence can be used in metaprogramming whene...
Definition type_traits.hh:742
Return the size of a Type T containing other types at compile time. If no object for which an overloa...
Definition type_traits.hh:438
Check if a type T has a edge descriptor.
Definition type_traits.hh:374
Determine if type T is 'tuplelike'. This is not intended to be used explicitly, refer to 'has_static_...
Definition type_traits.hh:645
Determine if type T is tuple_like, i.e., has a compile time constant size which is smaller than std::...
Definition type_traits.hh:670
Check if a type T has a vertex descriptor.
Definition type_traits.hh:349
Check if a given type is homogeneous and has a size which is a compile time constant....
Definition type_traits.hh:608
Check if a type T is an associative container type, i.e. a container type T that defines T::key_type ...
Definition type_traits.hh:211
Check if a type is a container type, which does not include string types.
Definition type_traits.hh:176
Check if some type T is a graph by checking if it has edge - and vertex_descriptors.
Definition type_traits.hh:398
Check if a type T is iterable, i.e., if it defines T::iterable.
Definition type_traits.hh:150
Check if a type T is a linear container. A linear container for us is any type T that is a container ...
Definition type_traits.hh:281
Check if a type T is a random access container, i.e., any container type T that has an iterator tagge...
Definition type_traits.hh:317
Check if a type T is a string-like type, i.e. std::basic_string, const char*, char*,...
Definition type_traits.hh:105
Check if a type T is an unordered associative container type, i.e. a container type T that defines T:...
Definition type_traits.hh:246
typename remove_pointer< std::remove_all_extents_t< T > >::type type
Definition type_traits.hh:78
typename remove_pointer< std::remove_pointer_t< T > >::type type
Definition type_traits.hh:56
Helper function for removing pointer qualifiers from a type recursivly This is the recursion base cas...
Definition type_traits.hh:41
T type
Definition type_traits.hh:42
Function for removing the qualifiers from a type T. Qualifiers are 'const', 'volative',...
Definition type_traits.hh:90
std::remove_cv_t< remove_pointer_t< std::remove_reference_t< T > > > type
Definition type_traits.hh:92