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

C++

2101 readers
1 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
[–] lambalicious@lemmy.sdf.org 4 points 5 days ago (1 children)

If it's templated / generic, which IIRC is one of the reasons to try and use auto, then it has to go in the header anyway.

[–] bunitor@lemmy.eco.br 1 points 5 days ago (1 children)

technically it doesn't have to (you can always create a .tpp (which is still technically a header, i know, but it isn't a header header)), but i get what you mean

[–] lambalicious@lemmy.sdf.org 1 points 4 days ago

I mean it has to functionally be a header. Could even be a .c file, filename extensions stopped mattering before we even had C++03 and that's saying something!