• Lauchmelder@feddit.de
    link
    fedilink
    Deutsch
    arrow-up
    0
    ·
    edit-2
    6 months ago

    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

    • merthyr1831@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      6 months ago

      If C++/C were real languages for real programming they’d enforce this in the compiler.

      No sane language designer would say “it is imperative that you do not implement your class in its header file” then write a compiler designer to say “oh you implemented your code in the header file? lol lmao that rocks”

      They have played you all for fools.