Question Details

No question body available.

Tags

c++ namespaces idioms name-clash

Answers (1)

May 25, 2026 Score: 1 Rep: 140,140 Quality: Low Completeness: 70%

tl;dr: Don't use ::std.

Most C++ libraries I've seen use std:: without the prefix, internally. If we take Boost as a (prominent) example, we'll note that:

$ grep -r "std::" /usr/include/boost/ | wc -l
92088
$ grep -r "::std::" /usr/include/boost/ | wc -l
1046
$ grep -rl "std::" /usr/include/boost/ | cut -d/ -f5   | sort -u | wc -l
182
$ grep -rl "::std::" /usr/include/boost/ | cut -d/ -f5   | sort -u | wc -l
36

So, there is some use of ::std, but only in 1 of each 5 Boost libraries, and even there the use is limited. If it's good enough for most of the Boost people to use std::, it's good enough for your library. And you could also think of this advice as "vox populi, vox dei".