Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the detail namespace commonly used for

Tags:

c++

namespaces

In some of the larger projects or libraries (e.g. Eigen), you can see namespaces like internal or detail. I understand what is internal good for, but what is detail commonly used for? Is there any common convention for distributing code into namespaces like that (especially in case of libraries with public interface)?

like image 651
the swine Avatar asked Oct 24 '14 10:10

the swine


People also ask

What is namespace used for?

A namespace is a declarative region that provides a scope to the identifiers (the names of types, functions, variables, etc) inside it. Namespaces are used to organize code into logical groups and to prevent name collisions that can occur especially when your code base includes multiple libraries.

What is namespace give the example?

In an operating system, an example of namespace is a directory. Each name in a directory uniquely identifies one file or subdirectory. As a rule, names in a namespace cannot have more than one meaning; that is, different meanings cannot share the same name in the same namespace.

What are the benefits of using namespaces?

Advantages of namespace In one program, namespace can help define different scopes to provide scope to different identifiers declared within them. By using namespace - the same variable names may be reused in a different program.

What is the use of using namespace std in C++?

The using namespace statement just means that in the scope it is present, make all the things under the std namespace available without having to prefix std:: before each of them.


1 Answers

A namespace called detail is typically used in just the same way as a namespace called internal. It's for "internal details" that are not visible in the public interface or which, at least, should be ignored by external users.

like image 193
Lightness Races in Orbit Avatar answered Sep 28 '22 11:09

Lightness Races in Orbit