namespaces user overloading c++
when authoring library sole namespace, it's mostly accessible yield overloaded operators classes namespace. seems (at slightest g++) overloaded operators implemented presumably library's namespace:
namespace lib {
class {
};
a operator+(const a&, const a&);
} // namespace lib
or tellurian namespace
namespace lib {
class {
};
} // namespace lib
lib::a operator+(const lib::a&, const lib::a&);
from testing, both seem work fine. there any receptive inadequacy between twin options? presumably proceed better?
Comments
Post a Comment