Why can std:set (with a single colon) compile?

At block scope, an identifier followed by a single colon introduces a label. Thus, your statement is equivalent to:

set<string> keys;

except that it bears the label std and can be jumped to by the statement goto std;.

For some reason, the name set is known to the compiler—perhaps you did using namespace std;, or using std::set;, or something like that, or perhaps you defined your own set type somewhere.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)