Open Veiasai opened 5 years ago
https://zh.cppreference.com/w/cpp/language/copy_elision
https://stackoverflow.com/questions/18486598/c-unexpected-behaviour-where-are-my-temporaries
T t = T(xx); 等价于T t(xxx); T t = func(); T func(); func会直接在t的空间上执行,也不会触发赋值。 总之,声明的时候用=,不会触发赋值。
https://zh.cppreference.com/w/cpp/language/copy_elision
https://stackoverflow.com/questions/18486598/c-unexpected-behaviour-where-are-my-temporaries