Returning a reference to a singleton is safer, because it prevents users from deleting it.
Reference: Modern C++ Design: Generic Programming and Design Patterns Applied by Andrei Alexandrescu. Addison-Wesley, 2001, p. 132.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment