0

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.

javaLover
  • 6,347
  • 2
  • 22
  • 67
  • 1
    ReSharper C++ at the moment only shows expansions of template parameters when a template function is called. We'll consider expanding this feature to cover your use case and will also show expansions of typedefs/type aliases in the function type. You can follow [RSCPP-19656](https://youtrack.jetbrains.com/issue/RSCPP-19656), thanks for the suggestion! – Igor Akhmetov May 22 '17 at 12:12
  • @Igor Akhmetov Thank a lot! I have another new question specifically about macro in resharper-c++. I would be really glad if you may take a look! https://stackoverflow.com/questions/44149003/resharper-subtituate-macro-with-multi-line-code – javaLover May 24 '17 at 04:31

0 Answers0