File tree Expand file tree Collapse file tree 6 files changed +7
-7
lines changed Expand file tree Collapse file tree 6 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ egon(std::string& str)
68
68
69
69
struct book : public sigc ::trackable
70
70
{
71
- book (const std::string& name) : name_(name) {}
71
+ explicit book (const std::string& name) : name_(name) {}
72
72
73
73
// non-copyable:
74
74
book (const book&) = delete ;
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ std::ostringstream result_stream;
16
16
class Param : public sigc ::trackable
17
17
{
18
18
public:
19
- Param (const std::string& name) : name_(name) {}
19
+ explicit Param (const std::string& name) : name_(name) {}
20
20
21
21
// non-copyable,
22
22
// so it can only be used with sigc::bind() via sigc::ref()
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ class RefPtr
86
86
* Increments the reference count.
87
87
*/
88
88
template <typename T_CastFrom>
89
- inline RefPtr (const RefPtr<T_CastFrom>& src);
89
+ inline explicit RefPtr (const RefPtr<T_CastFrom>& src);
90
90
91
91
/* * Swap the contents of two RefPtr<>.
92
92
* This method swaps the internal pointers to T_CppObject. This can be
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ struct foo
27
27
28
28
struct bar : public sigc ::trackable
29
29
{
30
- bar (int i = 0 ) : i_(i) {}
30
+ explicit bar (int i = 0 ) : i_(i) {}
31
31
operator int () { return i_; }
32
32
int i_;
33
33
};
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ class Functor1
62
62
public:
63
63
using result_type = std::string;
64
64
65
- Functor1 (const bar_group4& bar) : bar_(bar) {}
65
+ explicit Functor1 (const bar_group4& bar) : bar_(bar) {}
66
66
67
67
std::string operator ()(int i) { return (i < 0 ) ? " negative" : ((i > 0 ) ? " positive" : " zero" ); }
68
68
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ namespace
59
59
class MyClass1 : public sigc ::trackable
60
60
{
61
61
public:
62
- MyClass1 (const std::string& str) : s(str) {}
62
+ explicit MyClass1 (const std::string& str) : s(str) {}
63
63
64
64
void execute (int i) { result_stream << s << i; }
65
65
private:
@@ -69,7 +69,7 @@ class MyClass1 : public sigc::trackable
69
69
class MyClass2 : public ns_ext ::NsExtClass, public sigc::trackable
70
70
{
71
71
public:
72
- MyClass2 (const std::string& str) : s(str) {}
72
+ explicit MyClass2 (const std::string& str) : s(str) {}
73
73
74
74
void execute (int i) { result_stream << s << i; }
75
75
private:
You can’t perform that action at this time.
0 commit comments