This commit is contained in:
EmsiaetKadosh
2025-01-21 15:41:32 +08:00
parent b86053c3a7
commit edcc095979
17 changed files with 471 additions and 88 deletions
+24
View File
@@ -0,0 +1,24 @@
//
// Created by EmsiaetKadosh on 25-1-20.
//
#pragma once
struct B {
int a = 1;
B() { std::wcout << L"common constructor\n"; }
B(B&) { std::wcout << L"copy constructor\n"; }
// B(B&& other) noexcept { std::wcout << L"move constructor\n"; }
};
struct A {
B b;
explicit A(B&& other) : b(other) {}
};
inline void test() {
B b;
A a{ B() };
a = A(std::move(a.b));
}