Reputation: 21200
Why we can access value_type
by myType::value_type
, any c++ reference talk about it?
class myType{
public:
typedef double value_type; // the type for elements in the array
private:
};
Upvotes: 0
Views: 102
Reputation: 153909
In your example, value_type
is a member of myType
. It's a name, and
name lookup says that it will be found in myType
. Whether the name
resolves to a typedef
, a variable, a function, or whatever can't
influence name lookup, since you have to find the name first, to know
what it means. (This is a simplification, and there are cases where the
type affects lookup; where depending on the type of symbol found in a
first lookup, a second lookup might occur.)
Upvotes: 1