Google C++ Style Guidefirst parameter have default values. The explicit keyword can be applied to a constructor or (since C++11) a conversion operator, to ensure that it can only be used when the destination type is explicit at at the point of use, e.g. with a cast. This applies not only to implicit conversions, but to C++11’s list initialization syntax: class Foo { explicit Foo(int x, double y); ... }; void Func(Foo f); Func({42 type appears before the function name. For example: int foo(int x); The new form, introduced in C++11, uses the auto keyword before the function name and a trailing return type after the argument list0 码力 | 83 页 | 238.71 KB | 1 年前3
共 1 条
- 1













