Skip to content
Snippets Groups Projects
Commit 6932a545 authored by Tommaso Fulghesu's avatar Tommaso Fulghesu
Browse files

Add check on empty range

parent d031dbaa
No related branches found
No related tags found
1 merge request!3694Add tests for empty RelationTable
Pipeline #6653916 passed
......@@ -221,6 +221,8 @@ namespace Functors::Functional {
using std::next;
using std::make_pair;
if ( begin( range ) == end( range ) ) throw std::runtime_error( "Attempt to iterate over an empty range" );
auto min_entry = std::accumulate(
next( begin( range ) ), end( range ),
make_pair( *begin( range ), functor( mask_arg, mask, *begin( range ), input... ) ),
......@@ -264,6 +266,8 @@ namespace Functors::Functional {
using std::next;
using std::make_pair;
if ( begin( range ) == end( range ) ) throw std::runtime_error( "Attempt to iterate over an empty range" );
auto max_entry = std::accumulate(
next( begin( range ) ), end( range ),
make_pair( *begin( range ), functor( mask_arg, mask, *begin( range ), input... ) ),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment