• Speiser0@feddit.org
    link
    fedilink
    arrow-up
    2
    ·
    5 months ago

    If a function body is expensive to parse, isn’t it then a complex function body that shouldn’t go into the header anyways?

    • lambalicious@lemmy.sdf.org
      link
      fedilink
      English
      arrow-up
      4
      ·
      5 months ago

      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.

      • beleza pura@lemmy.eco.br
        link
        fedilink
        arrow-up
        1
        ·
        5 months ago

        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
          link
          fedilink
          English
          arrow-up
          1
          ·
          5 months 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!