Applied cppcoreguidelines-pro-type-member-init,hicpp-explicit-conversionsm,modernize-use-default-member-init clang-tidy fixes

This commit is contained in:
Bartek Kryza
2022-12-20 22:53:20 +01:00
parent 1116c3ab67
commit 682c6648be
9 changed files with 20 additions and 37 deletions

View File

@@ -26,12 +26,7 @@ namespace clanguml::common::model {
std::atomic_uint64_t diagram_element::m_nextId = 1;
diagram_element::diagram_element()
: id_{0}
, nested_{false}
, complete_{false}
{
}
diagram_element::diagram_element() { }
diagram_element::id_t diagram_element::id() const { return id_; }

View File

@@ -77,11 +77,11 @@ public:
void complete(bool completed);
private:
id_t id_;
id_t id_{0};
std::string name_;
std::vector<relationship> relationships_;
bool nested_;
bool complete_;
bool nested_{false};
bool complete_{false};
static std::atomic_uint64_t m_nextId;
};

View File

@@ -47,6 +47,6 @@ public:
private:
std::string file_;
unsigned int line_{0};
unsigned int hash_;
unsigned int hash_{0};
};
} // namespace clanguml::common::model

View File

@@ -31,10 +31,7 @@ template <typename T> class optional_ref {
public:
using optional_type = T;
optional_ref()
: value_{nullptr}
{
}
optional_ref() { }
optional_ref(T *value) { value_ = value; }
@@ -112,7 +109,7 @@ public:
T *get() const { return value_; }
private:
T *value_;
T *value_{nullptr};
};
template <typename T>