File tree Expand file tree Collapse file tree 3 files changed +28
-12
lines changed Expand file tree Collapse file tree 3 files changed +28
-12
lines changed Original file line number Diff line number Diff line change @@ -70,15 +70,20 @@ void egon(std::string& str)
70
70
struct book : public sigc ::trackable
71
71
{
72
72
book (const std::string& name) : name_(name) {}
73
+
74
+ // non-copyable:
75
+ book (const book&) = delete ;
76
+ book& operator =(const book&) = delete ;
77
+
78
+ // non movable:
79
+ book (book&&) = delete ;
80
+ book& operator =(book&&) = delete ;
81
+
73
82
std::string& get_name () { return name_; }
74
83
operator std::string& () { return get_name (); }
75
84
76
85
private:
77
86
std::string name_;
78
-
79
- // non-copyable:
80
- book (const book&);
81
- book& operator =(const book&);
82
87
};
83
88
84
89
} // end anonymous namespace
Original file line number Diff line number Diff line change @@ -15,12 +15,16 @@ class Param : public sigc::trackable
15
15
: name_(name)
16
16
{}
17
17
18
- std::string name_;
18
+ // non-copyable,
19
+ // so it can only be used with sigc::bind() via sigc::ref()
20
+ Param (const Param&) = delete ;
21
+ Param& operator =(const Param&) = delete ;
22
+
23
+ // non movable:
24
+ Param (Param&&) = delete ;
25
+ Param& operator =(Param&&) = delete ;
19
26
20
- private:
21
- // non-copyable, so it can only be used with sigc::bind() via sigc::ref()
22
- Param (const Param&);
23
- Param& operator =(const Param&);
27
+ std::string name_;
24
28
};
25
29
26
30
void handler (Param& param)
Original file line number Diff line number Diff line change 24
24
class TestUtilities
25
25
{
26
26
public:
27
+
28
+ // Non-copyable:
29
+ TestUtilities (const TestUtilities&) = delete ;
30
+ TestUtilities& operator =(const TestUtilities&) = delete ;
31
+
32
+ // Non-movable:
33
+ TestUtilities (TestUtilities&&) = delete ;
34
+ TestUtilities& operator =(TestUtilities&&) = delete ;
35
+
27
36
static TestUtilities* get_instance ();
28
37
bool check_command_args (int argc, char * argv[]);
29
38
void check_result (std::ostringstream& result_stream, const std::string& expected_result);
@@ -35,9 +44,7 @@ class TestUtilities
35
44
static bool get_result_and_delete_instance ();
36
45
37
46
private:
38
- // Not copyable. These are not implemented.
39
- TestUtilities (const TestUtilities&);
40
- TestUtilities& operator =(const TestUtilities&);
47
+
41
48
42
49
TestUtilities ();
43
50
You can’t perform that action at this time.
0 commit comments