【发布时间】:2011-08-05 21:48:38
【问题描述】:
我对对象中重载函数的默认值有疑问。
如果我有如下的函数签名,默认值是否只计算一次或每次?
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();
【问题讨论】:
-
这里没有函数重载……
标签: c++ overloading default-arguments