DASH  0.3.0
dash::is_range< RangeType > Struct Template Reference

Definition of type trait dash::is_range<T> with static member value indicating whether type T is a model of the Range concept. More...

#include <Range.h>

Detailed Description

template<class RangeType>
struct dash::is_range< RangeType >

Definition of type trait dash::is_range<T> with static member value indicating whether type T is a model of the Range concept.

Implemented as test if dash::begin<T> and dash::end<T> are defined.

In the current implementation, range types must specify the return type of dash::begin<T> and dash::end<T> as type definition iterator.

This requirement will become obsolete in the near future.

Example:

bool g_array_is_range = dash::is_range<
>::value;
// -> true
bool l_array_is_range = dash::is_range<
>::value;
// -> true
struct inf_range {
typedef int * iterator;
typedef std::nullptr_t sentinel;
iterator begin() { ... }
sentinel end() { ... }
};
bool inf_range_is_range = dash::is_range<inf_range>::value;
// -> false
// because of missing definition
// iterator dash::end<inf_range> -> iterator
Currently requires specialization as workaround:
template <>
struct is_range<inf_range> : std::integral_value<bool, true> { };

Definition at line 243 of file Range.h.


The documentation for this struct was generated from the following file: