I am asking this question for readability reasons not for implementation.
I haven't found any article explaining any distinction between single prefixed underscore and double prefixed underscore or double prefix and suffix if any.
Is there a special meaning between these different styles that will help with readability? They seem random. Example 1 has all the variables to be only single prefix but then example 2 has the variables double prefixed.
- _single
using type = _Template<_Up, _Types...>;
- __double
struct __replace_first_arg
- __ prefixAndSuffixUnderscore__
namespace std __attribute__((__visibility__("default")))
From the c++ STL container
e.g: 1
namespace std __attribute__((__visibility__("default")))
{
class __undefined;
template <typename _Tp, typename _Up>
struct __replace_first_arg
{
};
template <template <typename, typename...> class _Template, typename _Up,
typename _Tp, typename... _Types>
struct __replace_first_arg<_Template<_Tp, _Types...>, _Up>
{
using type = _Template<_Up, _Types...>;
};
e.g: 2
template <typename _InputIterator, typename _Distance>
inline constexpr void
__advance(_InputIterator & __i, _Distance __n, input_iterator_tag)
{
do
{
if (__builtin_is_constant_evaluated() && !bool(__n >= 0))
__builtin_unreachable();
} while (false);
while (__n--)
++__i;
}
I have read about the conventions for avoiding prefixed underscores in c++ to avoid collision with names inside the STL headers like global macros objects etc. This is not my question.
Ive tried: https://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_02.html
What are the rules about using an underscore in a C++ identifier?
https://manual.gromacs.org/5.1.1/dev-manual/naming.html
Prefix try keyword with two underscore in c++
etc...
and there is just a lot going on with zero comments explaining what is happening. So my goal is to figure out if there is some meaning behind the reason they decided to write single underscores or double. I do think @NeilButterworth is on to something because every single uppercase seems to be a typename for the template.
– FredFrugal Nov 11 '22 at 12:29