this post was submitted on 02 Sep 2025
17 points (100.0% liked)

C++

2151 readers
4 users here now

The center for all discussion and news regarding C++.

Rules

founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] sukhmel@programming.dev 10 points 2 months ago* (last edited 2 months ago) (1 children)

Summary

If you want fast compile times, be careful with functions using auto as a return type in header files.

[–] LodeMike@lemmy.today 3 points 2 months ago (3 children)

Why the fuck do people do this to themselves.

[–] DapperPenguin@programming.dev 3 points 2 months ago (1 children)

From my discussion with C++ folk, auto is just part of the "modern" way of doing c++. Paired with the -> return type. Perhaps including that -> return type negates this problem? It's still strange to me. Feels more like Rust

[–] bitcrafter@programming.dev 2 points 2 months ago

One day the use of auto will grow so extensive that modern Python code will have more type annotations than modern C++ code!

[–] 6nk06@sh.itjust.works 1 points 1 month ago

Clean code, and compile-time is irrelevant for most projects.