ericniebler / range-v3

Range library for C++14/17/20, basis for C++20's std::ranges
Other
4.12k stars 441 forks source link

Extending range concepts and views #899

Open ghost opened 6 years ago

ghost commented 6 years ago

Suppose one want to extend the library with new range functionalities. I have few examples in mind:

What is the easiest way to extend the Range library to support such custom needs? I don't think the library can handle all the possible range extensions, so we may need a way to easily extend the existing views. A solution could be by inheritance or/and through an adapter but then, private members of views should be made accessible (protected instead of private ?)

Does this sounds like a possible way to go ?

Regard,

ericniebler commented 6 years ago

It's a very good question. I have wanted to investigate the possibility of using refinements of Range for the purpose of speeding up parallel range algorithms. I would start by studying Haskell's Par Monad and the Traversable and Foldable type classes, but this is just a starting point.