Comment

Comment by Kranar

It's best to pass a reference to specify that the argument shall not be null. Also avoid writing static functions in C++, make use of anonymous namespaces.

    namespace {
      int add_numbers(const Data& p) {
        return p.a + p.b;
      }
    }
parent Kranar 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton