forked from boostorg/fusion
Add new traits named has_no_bounds.
It is for special usecase: some thing like a window function.
This commit relative to c9ae4fc886
.
Users who wants to access out-of-bounds of sequence, specify new
category to it.
struct sequence {
struct category
: fusion::random_access_traversal_tag
, fusion::no_bounds_tag {};
...
};
All of bounds related intrinsics of the /no-bounds-sequence/ *should*
guarantee to be well-defined or SFINAE-friendly, or compile error.
This commit is contained in:
@@ -36,6 +36,8 @@ namespace boost { namespace fusion
|
||||
|
||||
struct associative_tag {};
|
||||
|
||||
struct no_bounds_tag {};
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename Tag>
|
||||
@@ -107,6 +109,13 @@ namespace boost { namespace fusion
|
||||
random_access_traversal_tag
|
||||
, typename category_of<T>::type>
|
||||
{};
|
||||
|
||||
template <typename T>
|
||||
struct has_no_bounds
|
||||
: is_base_of<
|
||||
no_bounds_tag
|
||||
, typename category_of<T>::type>
|
||||
{};
|
||||
}
|
||||
}}
|
||||
|
||||
|
Reference in New Issue
Block a user