A question dawned on me lately: Why bother having the scope resolution operator (::
) when the usage of the dot operator (.
) doesn't clash with the former?
Like,
namespace my_module
{
const int insane_constant = 69;
int some_threshold = 100;
}
In order to access some_threshold
, one would write my_module::some_threshold
. But the thing is the left hand side of ::
must be a namespace or a class, as far as I know, while that of the .
can never be a namespace or a class. Moreover, the order of ::
is higher than .
, which is really pointless in my opinion. Why make 2 distinct operators, both of which cannot be overloaded, with use cases can be covered with just one? I'm having a hard time finding any satisfying answer, so any clue on this matter is much appriciated.