class A {
class B {
public:
int gwe = 0;
};
array<B, 3> arr;
public:
A() {
arr[0].gwe; // When starting to type 'g', IDE will suggest autocompletion for 'gwe'
}
};
Now if you put on top of that: template<typename T>
The IDE will not autocomplete when trying to access a member of the array element.
Let it be Xcode, CLion, I have not tried VS but I am convinced it would also replicate the behaviour.
I have not experienced this before using generics with other languages such as C#, Java or Swift.
So why this has to happen to C++ exactly?
Parsing C++ correctly is an extremely complicated and time consuming problem.
If IDEs were to do it perfectly it would take, close to, as much time as compiling the application and you would get annoyed that your IDE was unresponsive.
So, to be responsive, IDEs do limited parsing in finite time, which means they don't always get it right.
Autocomplete and similar features are there to assist/help, but they are not the final truth - don't expect them to be.