this post was submitted on 22 Mar 2024
230 points (94.2% liked)

Programmer Humor

32464 readers
434 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 41 points 7 months ago* (last edited 7 months ago) (18 children)

Why are you putting the implementation in the .h file? You're supposed to declare in the header and implement in the .cpp files. The meme is reversed

[โ€“] [email protected] 12 points 7 months ago* (last edited 7 months ago)

There is an issue with templated code where the implementation does have to be in the header as well, though that is not the case here. C++20 introduced modules which I guess were meant to sort out this mess, but it has been a rocky road getting them to be supported by compilers.

load more comments (17 replies)