Changes
This commit is contained in:
-16
@@ -4,21 +4,5 @@
|
||||
|
||||
#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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user