In C++, abstract data types (ADTs) are implemented as classes with all member variables private and with the operations implemented as public member and nonmember functions and overloaded operators.
You can define an ADT as a class and place the definition of the class and the implementation of its member functions in separate files. You can then compile the ADT class separately from any program that uses it and you can use this same ADT class in any number of different programs.
A namespace is a collection of name definitions, such as class definitions and variable declarations.
There are three ways to use a name from a namespace: by making all the names in the namespace available with a using
directive, by making the single name available by a using
declaration for the one name, or by qualifying the name with the name of the namespace and the scope resolution operator.
You place a definition in a namespace by placing it in a namespace grouping for that namespace.
The unnamed namespace can be used to make a name definition local to a compilation unit.