superzmy
Senior Member
China
29 Posts |
Posted - Dec 22 2024 : 9:34:55 PM
|
struct StructA {}; class X { public: template<bool B> auto Foo1() const noexcept -> bool { return 1; }
template<bool B> auto Foo2(StructA * a) const noexcept -> bool { return 1; } };
void A() { X x; X * pX = new X{}; pX->template Foo1<true>(); //1 pX->Foo1<true>(); //2
StructA * a = nullptr; (&x)->template Foo2<true>(a); //3 ((X *) &x)->Foo2<true>(a); //4 } ----- Move input cursor to Foo1 or Foo2 (1/2/3/4) and test ctrl-shift-f (find reference). and only //2 will find success. |
|