No members available when using typedef

Suppose I have a class A that has a public init() method. When I create std::vector objects of type A , I can easily call this method for all objects:

 std::vector<A> v; /* filling vector with some objects */ v[1].init(); // Intellisense finds that v[1] object has method 'init()' 

But when I use typedef, I cannot access this method:

 typedef std::vector<A> a_vector; a_vector v; /* filling vector with some objects */ v[1]. // Intellisense says that v[1] object doesn't have any members available 

Why does using typedef cause this behavior?

+4
source share
1 answer

Probably just a crash in the VS2012 cache character definition file. Close the solution, delete the sdf file found in the solutions directory (named [SolutionName] .sdf) and reopen the solution. Give the character cache a few minutes to reassemble (depending on the size of your project) and hope for the best. Rinse and repeat when something goes wrong (and this will be, especially for solutions containing large amounts of code).

+3
source

All Articles