Re: How to iterate all k-subsets of a range in a specific order?

2012-10-05 Thread Tommi
Although, the only case, where this would be a problem is with a range of type T, where: 1) It's impossible to provide random access to T 2) T can't return a reference from its 'front' property 3) T is a finite range (not infinite) 4) 'front' property may return the same value at different

Re: How to iterate all k-subsets of a range in a specific order?

2012-10-05 Thread Ali Çehreli
On 10/05/2012 01:08 AM, Tommi wrote: I can write the following in C++ to iterate through all 2-subsets of a forward-range in that specific order: #include iterator #include boost/range/concepts.hpp template typename R void fun(const R r) { BOOST_CONCEPT_ASSERT(( ForwardRangeConceptR ));

Re: How to iterate all k-subsets of a range in a specific order?

2012-10-05 Thread Tommi
On Friday, 5 October 2012 at 09:37:51 UTC, Ali Çehreli wrote: This brings up a question: Should all range types implement opEquals() for range equality as opposed to identity equality of the underlying range (i.e. Take.source in this case). But even if the range concept was altered so that