Interconverting std::function with copyable_function – Arthur O'Dwyer
https://quuxplusone.github.io/blog/2026/07/26/function-explosion/
https://redd.it/1vbjtef
@r_cpp
https://quuxplusone.github.io/blog/2026/07/26/function-explosion/
https://redd.it/1vbjtef
@r_cpp
Arthur O’Dwyer
Interconverting std::function and copyable_function
C++11 introduced std::function as a type-erased
callable-object holder. function is badly designed in a few ways: Its rarely used
“go fish” API bloats
every user; it advertises operator() const even when the controlled object’s operator()
is mutating; it…
callable-object holder. function is badly designed in a few ways: Its rarely used
“go fish” API bloats
every user; it advertises operator() const even when the controlled object’s operator()
is mutating; it…
ranges and views for stack, queue, and priority_queue
I've always felt that exposing iterators for `std::stack` or `std::queue` doesn't quite make sense because iterating over them would typically change their state.
That said, the range features introduced in C++20/23 are just too tempting. 😄
I bet many C++ developers have had this thought at least once:
queue | views::values | views::to<std::vector>()
...or more generally, "What if I could use the ranges pipeline directly on a queue or stack?"
So I spent some time experimenting to see if I could make it work. Here's what I came up with.
[https://cognosnotes.com/blog/cpp-pop-range](https://cognosnotes.com/blog/cpp-pop-range/?v=2)
https://redd.it/1vbcuwa
@r_cpp
I've always felt that exposing iterators for `std::stack` or `std::queue` doesn't quite make sense because iterating over them would typically change their state.
That said, the range features introduced in C++20/23 are just too tempting. 😄
I bet many C++ developers have had this thought at least once:
queue | views::values | views::to<std::vector>()
...or more generally, "What if I could use the ranges pipeline directly on a queue or stack?"
So I spent some time experimenting to see if I could make it work. Here's what I came up with.
[https://cognosnotes.com/blog/cpp-pop-range](https://cognosnotes.com/blog/cpp-pop-range/?v=2)
https://redd.it/1vbcuwa
@r_cpp
Cognosnotes
Extending Ranges and Views to Non-Iterable Container Adaptors | Cognos Notes
1. Motivation
Static Analysis Experiment with Reflection
I want to share a little experiment that I made using reflection. It’s a compile-time style checker using C++26 static reflection. It validates the conventions I use in my own projects (the
Because reflection can’t properly see into uninstantiated templates yet, I had to write a parser for GCC's displaystringof to extract templates, qualifiers, return types, and requires clauses.
Given this weakness it's not a particularly production-ready tool. It could be done with a clang-tidy script, but I learned a few things just from trying to answer "Is it possible? What exactly can I inspect right now?". Unfortunately, we don't have code generation yet so there is a bunch of boilerplate that the user needs to write.
The rationale of the conventions (mainly
https://github.com/NotRiemannCousin/Viracocha/blob/master/VIRACOCHA.md
https://redd.it/1vc49yu
@r_cpp
I want to share a little experiment that I made using reflection. It’s a compile-time style checker using C++26 static reflection. It validates the conventions I use in my own projects (the
H_ curried callable thing, Mut/Mov/Ref/Cpy qualifier aliases, plus class/namespace naming).Because reflection can’t properly see into uninstantiated templates yet, I had to write a parser for GCC's displaystringof to extract templates, qualifiers, return types, and requires clauses.
Given this weakness it's not a particularly production-ready tool. It could be done with a clang-tidy script, but I learned a few things just from trying to answer "Is it possible? What exactly can I inspect right now?". Unfortunately, we don't have code generation yet so there is a bunch of boilerplate that the user needs to write.
The rationale of the conventions (mainly
Mut/Mov/Ref/Cpy) is in GUIDELINES.md. The gory implementation details (and my field notes on GCC bugs) are in VIRACOCHA.md.https://github.com/NotRiemannCousin/Viracocha/blob/master/VIRACOCHA.md
https://redd.it/1vc49yu
@r_cpp
GitHub
Viracocha/VIRACOCHA.md at master · NotRiemannCousin/Viracocha
My C++ coding guidelines. Contribute to NotRiemannCousin/Viracocha development by creating an account on GitHub.
BeCPP Symposium 2026 - Bryce Adelstein Lelbach - The CUDA C++ Developer's Toolbox
https://youtu.be/XShALzyd0YU
https://redd.it/1vd27y6
@r_cpp
https://youtu.be/XShALzyd0YU
https://redd.it/1vd27y6
@r_cpp
YouTube
BeCPP Symposium 2026 - Bryce Adelstein Lelbach - The CUDA C++ Developer's Toolbox
Event: BeCPP Symposium 2026 ( https://becpp.org/Symposium2026/ )
Slides: https://becpp.org/blog/2026/04/16/slides-of-the-becpp-symposium-2026-sessions/
Speaker: Bryce Adelstein Lelbach
Title: The CUDA C++ Developer's Toolbox
Abstract:
Getting the most out…
Slides: https://becpp.org/blog/2026/04/16/slides-of-the-becpp-symposium-2026-sessions/
Speaker: Bryce Adelstein Lelbach
Title: The CUDA C++ Developer's Toolbox
Abstract:
Getting the most out…