I've seen ::
in some documentations, e.g., xn::Generator::StartGenerating()
, and was wondering what it exactly signified?

- 5,965
- 14
- 31
- 57

- 934
- 3
- 10
- 16
-
3Which programming language are you speaking about? For example your snippet could be either ML or C++, and the `::` would means vastly different things in those two languages. – hmakholm left over Monica Aug 17 '11 at 21:22
-
Which documents you mean? May be C++ related? Give more detail otherwise it not a clear question – sll Aug 17 '11 at 21:23
-
1@Henning based on [the OP's tags](http://stackoverflow.com/users/866330/serioustyro#tags-title), it's [tag:c++]. Your point is still a valid one, though. – Matt Ball Aug 17 '11 at 21:26
-
@Matt Ball: Nice deduction, Sherlock! – johnsyweb Aug 17 '11 at 22:58
4 Answers
It's the scope resolution operator in C++.
http://en.wikipedia.org/wiki/Scope_resolution_operator
See also: whats the difference between dot operator and scope resolution operator.
In C++, that's scoping names so that it can tell what you're talking about. Namespace (like std::cout) and class member definitions (like MyClass::MyMethod) come to mind.

- 27,682
- 3
- 38
- 73
In C++ at least, it refers to some sort of scope resolution. This could be a namespace (for example StartGenerating
is a function within the namespace Generator
), or it could be a class (for example StartGenerating
is a static function in the class Generator
)
Either way, it narrows the scope in which C++ will search for an identifier.

- 14,033
- 6
- 51
- 68
To add to the answers already here, after doing a quick google for "Double colon notation" I came across the following for PHP:
In short, it’s used to access Static or Constant members of a class
Source: http://www.whypad.com/posts/php-using-the-double-colon/500/
There's a brief discussion here on Stack Overflow also on the differences between the double colon and and arrow operators.

- 1
- 1

- 53,019
- 19
- 125
- 162
-
1In PHP, the scope resolution operator (`::`) is also known as _paamayim nekudotayim_ -- Hebrew for "double colon". Some of the key contributors to PHP are from Israel. They used the (to them) obvious name for the operator and it stuck. Now if you see a PHP error message complaining about "unexpected T_PAAMAYIM_NEKUDOTAYIM" or the like, you'll at least know what it's saying. :) – Ted Hopp Mar 09 '12 at 07:50