Skip to content
Snippets Groups Projects
Commit cfa9240f authored by Ansgar Burchardt's avatar Ansgar Burchardt
Browse files

Merge branch 'cherry-pick-a6527917' into 'releases/2.5'

Merge branch 'feature/improve-is_range' into 'master'

Improve is_range

This avoids the `sizeof` hack in favour of a more idiomatic version
and also implements checks for all needed expressions:
* existenz of r.begin()
* existenz of r.end()
* inequality comparison of iterator and end-iterator
* end-iterator converts to iterator (dropped in C++17)
* prefix increment of iterator
* dereference of iterator
   
In order to avoid a "computed value not used warning" we
add an additional call to a dummy function.
    
In fact this check is not complete, because it only accepts
member begin() and end(). Adding support for std:: and adl-version
would require a more complicated helper and thus better be placed
in a real concept definition.

See merge request !187

See merge request !188
parents 12f8f5b7 7cbe9580
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment