3 ms·
There is a proper place for everything, and others for everything else. You can make a zero-overhead analog of optional<int>, for such cases, for clarity and s
by ncmncm 5y ago
There is a proper place for everything, and others for everything else.
You can make a zero-overhead analog of optional<int>, for such cases, for clarity and safety. (Unless you are also trying to present a C API for cross-language compatibility...) But it is tricky to determine the exact amount of handholding to provide for such a type, and extra work to remember exactly what it is. We all know how ints work.