gpt4 book ai didi

c++ - 这两种在 C++ 中实现函数的方法有什么区别?

转载 作者:行者123 更新时间:2023-11-30 01:17:10 26 4
gpt4 key购买 nike

假设我有一个复制构造函数

第一种方式:

Car(Car const& other)
: Model{other.Model}, Something{other.Something}
{}

第二种方式:

Car(Car const& other) 
{
Model = other.Model;
Something = other.Something;
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com