r/cpp • • Jun 26 '26

projections for stl data structures

using projection in ranges::sort has removed the need write a compartor function or a lambda and is much easier to implement in my opinion

there should exists a similar feature for say sets or priority queues

would be wonnderful if I could just write

priority_queue<Student, Student::marks> for example

21 Upvotes

7 comments sorted by

View all comments

Show parent comment

2

u/_Noreturn Jul 05 '26

I do agree, they are complex in every way from using concepts, bloated interfaces and bad debugability and bad compile times. it is laughable that they succeed in sucking in every way.

It is just that the committee never uses the stl before shoving it down our throats so we get garbage.