We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
google-explicit-constructor
noExplicitConstructor
1 parent 57e0ff3 commit c8a23dcCopy full SHA for c8a23dc
2 files changed
cli/cppcheckexecutor.cpp
@@ -301,7 +301,7 @@ int CppCheckExecutor::check_internal(CppCheck& cppcheck)
301
mLatestProgressOutputTime = std::time(nullptr);
302
303
if (!settings.outputFile.empty()) {
304
- mErrorOutput = new std::ofstream(settings.outputFile);
+ mErrorOutput = safe_ptr<std::ofstream>(new std::ofstream(settings.outputFile));
305
}
306
307
if (settings.xml) {
lib/safeptr.h
@@ -30,7 +30,7 @@ template<typename T>
30
class safe_ptr
31
{
32
public:
33
- safe_ptr(T* p)
+ explicit safe_ptr(T* p)
34
: mPtr(p)
35
{}
36
@@ -58,7 +58,7 @@ class safe_ptr
58
return *mPtr;
59
60
61
- operator bool() const NOEXCEPT {
+ explicit operator bool() const NOEXCEPT {
62
return mPtr != nullptr;
63
64
0 commit comments