これは私が長い間疑問に思っていたことです。次の例を見てください。
struct matrix
{
float data[16];
};
この特定の例でデフォルトのコンストラクターとデストラクターが何をするかは知っていますが (何もありません)、コピー コンストラクターとコピー代入演算子はどうでしょうか。
struct matrix
{
float data[16];
// automatically generated copy constructor
matrix(const matrix& that) : // What happens here?
{
// (or here?)
}
// automatically generated copy assignment operator
matrix& operator=(const matrix& that)
{
// What happens here?
return *this;
}
};
std::copy
それは、またはstd::uninitialized_copy
またはmemcpy
または何を含みますmemmove
か?