Content assist : clue of type of a function that has parameter type depend on "using" inside T

64 Views Asked by At

How to make Visual Studio show a completely-deduced content-assist for a function that has type depends on alias of a T?

Example

b.f in the example can't give me a completely-deduced content-assist.
It should clue int, not SomeClass::A<int>::AT.

class SomeClass{
    template<class T>class A{public: using AT=T;};
    template<class AX>class B{public: void f( typename AX::AT){}};
    template<class AX,class X>class C{public: void f( typename X){}};
    public: void test(){
        B<A<int>> b;     b.f(
    }
};

Testing b.f() :-

enter image description here

Poor Workaround

I have to refactor B<A<int>> to C<A<int>,int>.

template<class T>class A{public: using AT=T;};
template<class AX,class X>class C{public: void f( typename X){}};
public: void test(){
    C<A<int>,int> c;  c.f(
}

Testing c.f() :-

enter image description here

I may rely on content-assist too much, but it greatly helps a newbie like me.

0

There are 0 best solutions below