r/cpp • u/Odd_Comparison3831 • 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
View all comments
Show parent comment
5
u/_Noreturn Jun 26 '26
I meant transparent as in no call stack emitted, when debugging you will see alot of useless one linecallstacks which are annoying
Gasper Azman https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2026/p2826r3.html proposes to fix it by introducing a new alias type and the above could be rewritten to (it is an awesome paper)
this removes unnecessary callstacks and should be faster to compile less work for the linksr