4
我有一個對象的過載函數默認值的問題。函數超載中的C++默認參數會被一次或每次計算出來?
如果我有一個函數簽名如下,默認值只能評估一次或每次?
class X
{
public:
f(const RWDate& d=RWDate::now());
}
// when calling f() do I get the current time each time?
X z;
z.f();
// is the default value of d recaculated in the function call?
z.f();