A nonmember function is defined outside a class and does not belong to a class instance. In C++, functions may be members, nonmembers, or nonmember friends; choosing among them affects encapsulation and future maintenance. section 9.12
A formatting operation is often a good candidate for a nonmember. Keep the Date representation private, expose a small public interface, and let formatting call const accessors instead of coupling itself to stored fields. A friend can access private data directly, but friends should not alter object state. section 9.12
