On Sun, 6 Jun 2021, 17:57 Eric Suen via Std-Discussion, <std-discussion@lists.isocpp.org> wrote:
The following code, how do parser know that V is template and B is not?

NSDMIs are evaluated in a complete-class context. This is one reason they can't be `auto`. 

struct A {
   int a = V<1>();
   bool b = B < 0;

   void print() {
     std::cout << a;
   }

   template<int v>
   static int V() {
     return v;
   }

   static int B;
};

int A::B = 1;

int main() {
   A a;
   a.print();
}
--
Std-Discussion mailing list
Std-Discussion@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-discussion