π
At that stage, you normally change the language. Perl or python, for example.
@nixCraft aahh, so lame here.
I expected to see some kind of 'is NULL a value?' typish flame-war. (context: SQL, not C preprocessor)
@nixCraft Easy:
if (the function will consume/own the object) {
pass instance using move-construction;
} else if (the function will keep a reference that it does not own) {
pass by std::shared_ptr or possibly std::weak_ptr;
} else if (the parameter is optional) {
pass by pointer and check for null;
} else {
pass by reference;
}