2023-06-29 11:55:02 +08:00

29 lines
476 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#### 继承构造函数
```
struct A{
void f(double i){}
A(){}
A(int i){}
A(float f){}
};
struct B:A{
using A:A;
using A:f;
void f(double i){}
}
int main(){
B b;//会调用A的对应构造函数
b.f;//会调用A的函数
}
```
不过使用了继承构造函数,就无法通过构造函数初始化派生类成员了。
#### 用户自定义字面量
可以定义出2.0f或者123_w之类的写法表达瓦特与浮点