3#ifndef DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH
4#define DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH
8#include <dune/common/typeutilities.hh>
24template<
class T,
class... Args>
26 std::is_constructible<T, Args...>::value,
int>::type;
34 constexpr auto staticSize(
const T*,
const PriorityTag<0>&)
35 ->
decltype(std::integral_constant<std::size_t,T::size()>())
42 constexpr auto staticSize(
const T*,
const PriorityTag<1>&)
43 ->
decltype(std::integral_constant<std::size_t,T().size()>())
50 constexpr auto staticSize(
const T*,
const PriorityTag<2>&)
51 ->
decltype(std::integral_constant<std::size_t,std::tuple_size<T>::value>())
57 constexpr std::false_type hasStaticSize(
const T* t,
const PriorityTag<0>& p)
63 constexpr auto hasStaticSize(
const T* t,
const PriorityTag<1>& p)
64 ->
decltype(staticSize(t ,PriorityTag<42>()), std::true_type())
82 public decltype(Imp::hasStaticSize((typename std::decay<T>::type*)(nullptr), PriorityTag<42>()))
96 public decltype(Imp::staticSize((typename std::decay<T>::type*)(nullptr), PriorityTag<42>()))
typename std::enable_if< std::is_constructible< T, Args... >::value, int >::type enableIfConstructible
Helper to constrain forwarding constructors.
Definition: type_traits.hh:26
Definition: polynomial.hh:10
Check if type is a statically sized container.
Definition: type_traits.hh:83
Obtain size of statically sized container.
Definition: type_traits.hh:97