-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathClient03.cpp
More file actions
27 lines (20 loc) · 739 Bytes
/
Client03.cpp
File metadata and controls
27 lines (20 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// ===========================================================================
// Client.cpp - Pimpl Idiom with Copy- & Move-Semantics
// ===========================================================================
#include <iostream>
#include "Control.h"
void pimpl_03()
{
using namespace PimplVariantWithCopyMoveSemantics;
Control ctrl;
ctrl.resize(100, 20);
ctrl.setText("sample control");
ctrl.hide();
Control c2 = ctrl; // copy: compiles !!!
c2.show();
Control c3 = std::move(ctrl); // move: compiles !!!
c3.hide();
}
// ===========================================================================
// End-of-File
// ===========================================================================