After many moons, the story is like this:
Given,
int array [ 12 ] = { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 };
The sequence of function calls
// reflexive returns true, is_prime is true for primes (hard-coded for now) and is_even returns true for even numbers.
abc = query::as_query( abc ).where( reflexive( ) ).where( is_prime( ) ).where( is_even( ) ).to_array( );
for( int i = 0 ; i < abc.size( ) ; ++i )
std::cout << abc [ i ] << ‘ ‘;
prints 2. Btw, there was a serious bug in the implementation of where( ) which is fixed now.
Additionally,
> Query.exe!query::queryable<
query::filter_iterator<
query::filter_iterator<
std::_Vector_iterator<int,std::allocator<int> >,
reflexive>,
is_prime> >::
where<is_even>(const is_even & fn={…}) Line 240 C++
This should prove delayed execution I believe. Now, all I have to do is wait for lambda expressions in C++, coming sometime next year.