For reference, the exact definition of std::queue listed here . Therefore, in response to
In other words, is the standard state clear that this variable needs to be called c ?
Yes, this is the case (and similarly for other container adapters);
template <class T, class Container = deque<T>> class queue { protected: Container c;
In general, however, the names of protected and private names and members are not standardized, because the types are not all built to be retrieved, and the implementation is an implementation detail (and is not part of the public API); for example std::vector does not contain any protected names.
Some containers and std classes define protected member names, in particular, I like the iostreams library - basically the types that need to be received.
As a follow up - do all compilers / libraries use c ? It seems that at least the core ones (libstdc ++, libc ++ and msvc). libstdC ++ is interesting in that it includes following a comment on a variable;
_Sequence c;
source share