We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a8e7ef6 commit 350a09bCopy full SHA for 350a09b
1 file changed
src/lib/util/optional.h
@@ -96,6 +96,7 @@ class Optional {
96
/// @todo: when C++17 will be required can be solved using "if contexpr"
97
/// for type convertible from int or default constructible.
98
/// This will fix complains from code checkers e.g. cppcheck CWE 476.
99
+ // cppcheck-suppress nullPointer
100
Optional()
101
: default_(T(0)), unspecified_(true) {
102
}
@@ -116,6 +117,9 @@ class Optional {
116
117
/// @brief Retrieves the encapsulated value.
118
///
119
/// @return the encapsulated value
120
+ ///
121
+ /// @note Reference types are explicitely excluded.
122
+ // cppcheck-suppress returnByReference
123
T get() const {
124
return (default_);
125
0 commit comments