We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bf0a81c commit d3a6edbCopy full SHA for d3a6edb
04-Considering_Safety.md
@@ -9,38 +9,19 @@
9
class MyClass
10
{
11
public:
12
- MyClass(std::string t_value)
13
- : m_value(t_value)
14
- {
15
- }
16
-
17
- std::string get_value()
18
19
- return m_value;
20
21
22
-private:
23
- std::string m_value;
+ void do_something(int i);
+ void do_something(std::string str);
24
};
25
26
27
// Good Idea
28
29
30
31
- MyClass(const std::string &t_value)
32
33
34
35
36
- std::string get_value() const
37
38
39
40
41
42
+ void do_something(const int i);
+ void do_something(const std::string &str);
43
+
44
```
45
46
### Consider Return By Value for Mutable Data, `const &` for Immutable
0 commit comments