dune-common
2.5-git
|
Namespaces | |
Imp | |
Impl | |
Classes | |
class | integer_sequence |
an implementation of std::integer_sequence as introduced in C++14 More... | |
struct | is_callable |
Traits class to check if function is callable. More... | |
struct | is_callable< F(Args...), R > |
Traits class to check if function is callable. More... | |
struct | MakeUniqueHelper |
struct | MakeUniqueHelper< T[]> |
struct | MakeUniqueHelper< T[N]> |
class | to_false_type |
template mapping a type to std::false_type More... | |
class | to_true_type |
template mapping a type to std::true_type More... | |
Typedefs | |
template<bool value> | |
using | bool_constant = std::integral_constant< bool, value > |
A template alias for std::integral_constant<bool, value> More... | |
template<std::size_t... Ints> | |
using | index_sequence = integer_sequence< std::size_t, Ints... > |
std::index_sequence as introduced in C++14 More... | |
template<typename T , T n> | |
using | make_integer_sequence = typename impl::_make_integer_sequence< T, 0, n >::type |
template<std::size_t n> | |
using | make_index_sequence = make_integer_sequence< std::size_t, n > |
template<typename... T> | |
using | index_sequence_for = make_index_sequence< typename Dune::SizeOf< T... >{}> |
Create index_sequence from 0 to sizeof...(T)-1. More... | |
Functions | |
template<class F , class ArgTuple > | |
decltype(auto) | apply (F &&f, ArgTuple &&args) |
Apply function with arguments given as tuple. More... | |
template<typename... Args> | |
std::array< typename std::common_type< Args... >::type, sizeof...(Args)> | make_array (const Args &... args) |
Create and initialize an array. More... | |
template<typename T , typename... Args> | |
MakeUniqueHelper< T >::NonArrayUniquePtr | make_unique (Args &&... args) |
Implementation of std::make_unique to be introduced in C++14. More... | |
template<typename T > | |
MakeUniqueHelper< T >::UnknownBoundArrayUniquePtr | make_unique (size_t n) |
Implementation of std::make_unique to be introduced in C++14. More... | |
template<typename T , typename ... Args> | |
MakeUniqueHelper< T >::KnownBoundArrayUniquePtr | make_unique (Args &&... args)=delete |
Implementation of std::make_unique to be introduced in C++14. More... | |
using Dune::Std::bool_constant = typedef std::integral_constant<bool, value> |
A template alias for std::integral_constant<bool, value>
value | Boolean value to encode as std::integral_constant<bool, value> |
using Dune::Std::index_sequence = typedef integer_sequence< std::size_t, Ints... > |
std::index_sequence as introduced in C++14
...Ints | a non-type parameter pack |
using Dune::Std::index_sequence_for = typedef make_index_sequence<typename Dune::SizeOf<T...>{}> |
Create index_sequence from 0 to sizeof...(T)-1.
This should do the same as std::index_sequence_for. But due to a bug in the sizeof... operator this may produce wrong results with clang<3.8.
As a workaround we provide our own implementation that avoids this bug even if the std:: version exists.
This implemenation can be dropped, once we require a minimum clang version that has this bug fixed (i.e. >=3.8).
using Dune::Std::make_index_sequence = typedef make_integer_sequence<std::size_t,n> |
using Dune::Std::make_integer_sequence = typedef typename impl::_make_integer_sequence<T,0,n>::type |
decltype(auto) Dune::Std::apply | ( | F && | f, |
ArgTuple && | args | ||
) |
Apply function with arguments given as tuple.
f | A callable object |
args | Tuple of arguments |
This will call the function with arguments generated by unpacking the tuple.
std::array<typename std::common_type<Args...>::type, sizeof...(Args)> Dune::Std::make_array | ( | const Args &... | args | ) |
Create and initialize an array.
|
delete |
Implementation of std::make_unique to be introduced in C++14.
T | Nonarray type of object to be constructed |
...Args | Parameter types for constructor of T |
args | Arguments to be passed to constructor of T |
This fallback implementation using perfect forwarding as proposed by Herb Sutter in http://herbsutter.com/gotw/_102/
MakeUniqueHelper<T>::UnknownBoundArrayUniquePtr Dune::Std::make_unique | ( | size_t | n | ) |
Implementation of std::make_unique to be introduced in C++14.
T | Array type of unknown bound |
n | Size of array to allocate |
|
delete |
Implementation of std::make_unique to be introduced in C++14.
T | Array type of known bound |
Args | Dummy arguments |
This is deleted, since, according to the standard this should not participate in overload resolution
args | Dummy arguments |
T | Nonarray type of object to be constructed |
...Args | Parameter types for constructor of T |
args | Arguments to be passed to constructor of T |
This fallback implementation using perfect forwarding as proposed by Herb Sutter in http://herbsutter.com/gotw/_102/