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;
}
}