
struct A { int y; string func(double x) { return(__FUNCSIG__); } }; struct B : public A { string func(int x) // the method hides A::func { return(__FUNCSIG__); } }; void OnStart(void) { B b; b.func(M_PI); // according to new rules, it is a call to B::func b.A::func(M_PI); // call the hidden method A::func }此更改简化了代码的可读性,消除了以前只伴随编译器警告的歧义。
input int somename=42; int somename(int x) { return(42); }
int somename(ENUM_TIMEFRAMES TF=PERIOD_CURRENT); int somename(ENUM_TIMEFRAMES TF=0) // error, type mismatch for the default parameter value, despite having the same value { return(42); }
enum A { Value }; enum B { Value // error, name 'Value' is already used in enumeration A }; void OnStart(void) { enum C { Value // OK, 'Value' is not used within the OnStart scope }; }匹配的名称可在不同的作用域中使用。
template<typename T> void Initializer(matrix<T>& mat,int method=0); matrix<double> A(10,10,Initializer,42); // error, Initializer must be explicitly typed matrix<double> A(10,10,Initializer<double>); // error, missing 'method' parameter (default values no longer supported) matrix<double> A(10,10,Initializer<double>,42); // OK