C2025: Default argument expression can only contain static or global objects or constants

[ERROR]

Description

A local object or non-static class member was used in the expression for a default argument.

Example
  struct A {

  
    int t;

  
    void f(int i=t);  // error

  
  };

  
  void g(int i, int j=i); // error

  
Tips

Only use static or global objects or constants in expressions for default arguments.