On Tue, Jun 24, 2025 at 3:49 PM Peter Bindels <dascandy@gmail.com> wrote:


On Tue, Jun 24, 2025 at 3:30 PM Simon Schröder via Std-Proposals <std-proposals@lists.isocpp.org> wrote:

On Tue, Jun 24, 2025 at 3:01 PM Peter Bindels via Std-Proposals <std-proposals@lists.isocpp.org> wrote:
 and ideally output documentation with C++26 reflection.

I also thought about reflection to get documentation from (user-defined) attributes. Can we already write to files in compile time code?

You can create code at compile time, that then outputs documentation when run. It's a minor difference but IMO not impactful - and arguably better. You can reflect on structs used in a web server and output Swagger data for them, and be guaranteed that your website and the swagger "file" in it are the same.

I'd prefer to generate documentation at compile time, but could certainly live with running my app in a specific way to output it at runtime. It seems that Swagger could be the JSON output I was talking about (or YAML, but I dislike YAML).