mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2025-12-17 12:44:42 +03:00
[I.27] fix move ctor in the pimpl example (closes #1471)
This commit is contained in:
@@ -2212,7 +2212,7 @@ interface (widget.h)
|
|||||||
void draw(); // public API that will be forwarded to the implementation
|
void draw(); // public API that will be forwarded to the implementation
|
||||||
widget(int); // defined in the implementation file
|
widget(int); // defined in the implementation file
|
||||||
~widget(); // defined in the implementation file, where impl is a complete type
|
~widget(); // defined in the implementation file, where impl is a complete type
|
||||||
widget(widget&&) = default;
|
widget(widget&&); // defined in the implementation file
|
||||||
widget(const widget&) = delete;
|
widget(const widget&) = delete;
|
||||||
widget& operator=(widget&&); // defined in the implementation file
|
widget& operator=(widget&&); // defined in the implementation file
|
||||||
widget& operator=(const widget&) = delete;
|
widget& operator=(const widget&) = delete;
|
||||||
@@ -2229,6 +2229,7 @@ implementation (widget.cpp)
|
|||||||
};
|
};
|
||||||
void widget::draw() { pimpl->draw(*this); }
|
void widget::draw() { pimpl->draw(*this); }
|
||||||
widget::widget(int n) : pimpl{std::make_unique<impl>(n)} {}
|
widget::widget(int n) : pimpl{std::make_unique<impl>(n)} {}
|
||||||
|
widget::widget(widget&&) = default;
|
||||||
widget::~widget() = default;
|
widget::~widget() = default;
|
||||||
widget& widget::operator=(widget&&) = default;
|
widget& widget::operator=(widget&&) = default;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user