Type within namespace in c++
Suppose I defined A::B::int
, how can I refer to开发者_如何转开发 the standard C++ int
inside A::B
?
You cannot have a typedef named int
, even if it is in a namespace. int
is a keyword.
Keywords are reserved for their specific uses and you cannot use them for any other purpose in your code.
You can't.
$3.4.2/2-
'If T is a fundamental type, its associated sets of namespaces and classes are both empty.
This means that fundamental types do not have any namespace associated with them.
So you can't even say ::int for this reason.
精彩评论