Fix -Weffc++ warnings (GNU 6.3.1)
This commit is contained in:
parent
758c4addc1
commit
9cfb777b65
3 changed files with 340 additions and 844 deletions
1156
src/json.hpp
1156
src/json.hpp
File diff suppressed because it is too large
Load diff
|
@ -6168,6 +6168,21 @@ class basic_json
|
||||||
thousands_sep(!loc->thousands_sep ? '\0' : loc->thousands_sep[0]),
|
thousands_sep(!loc->thousands_sep ? '\0' : loc->thousands_sep[0]),
|
||||||
decimal_point(!loc->decimal_point ? '\0' : loc->decimal_point[0])
|
decimal_point(!loc->decimal_point ? '\0' : loc->decimal_point[0])
|
||||||
{}
|
{}
|
||||||
|
serializer(const serializer& cpy)
|
||||||
|
: o(cpy.o),
|
||||||
|
thousands_sep(cpy.thousands_sep),
|
||||||
|
decimal_point(cpy.decimal_point),
|
||||||
|
loc(cpy.loc),
|
||||||
|
indent_string(cpy.indent_string)
|
||||||
|
{}
|
||||||
|
serializer& operator=(const serializer& rhs) {
|
||||||
|
o = rhs.o;
|
||||||
|
thousands_sep = rhs.thousands_sep;
|
||||||
|
decimal_point = rhs.decimal_point;
|
||||||
|
loc = rhs.loc;
|
||||||
|
indent_string = rhs.indent_string;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@brief internal implementation of the serialization function
|
@brief internal implementation of the serialization function
|
||||||
|
|
|
@ -49,16 +49,19 @@ enum class country
|
||||||
struct age
|
struct age
|
||||||
{
|
{
|
||||||
int m_val;
|
int m_val;
|
||||||
|
age(int rhs=0) : m_val(rhs) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct name
|
struct name
|
||||||
{
|
{
|
||||||
std::string m_val;
|
std::string m_val;
|
||||||
|
name(const std::string rhs="") : m_val(rhs) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct address
|
struct address
|
||||||
{
|
{
|
||||||
std::string m_val;
|
std::string m_val;
|
||||||
|
address(const std::string rhs="") : m_val(rhs) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct person
|
struct person
|
||||||
|
@ -66,18 +69,24 @@ struct person
|
||||||
age m_age;
|
age m_age;
|
||||||
name m_name;
|
name m_name;
|
||||||
country m_country;
|
country m_country;
|
||||||
|
person() : m_age(),m_name(),m_country() {}
|
||||||
|
person(const age& a, const name& n, const country& c) : m_age(a), m_name(n), m_country(c) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct contact
|
struct contact
|
||||||
{
|
{
|
||||||
person m_person;
|
person m_person;
|
||||||
address m_address;
|
address m_address;
|
||||||
|
contact() : m_person(), m_address() {}
|
||||||
|
contact(const person& p, const address& a) : m_person(p), m_address(a) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct contact_book
|
struct contact_book
|
||||||
{
|
{
|
||||||
name m_book_name;
|
name m_book_name;
|
||||||
std::vector<contact> m_contacts;
|
std::vector<contact> m_contacts;
|
||||||
|
contact_book() : m_book_name(), m_contacts() {}
|
||||||
|
contact_book(const name& n, const std::vector<contact>& c) : m_book_name(n), m_contacts(c) {}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -319,6 +328,8 @@ namespace udt
|
||||||
struct legacy_type
|
struct legacy_type
|
||||||
{
|
{
|
||||||
std::string number;
|
std::string number;
|
||||||
|
legacy_type() : number() {}
|
||||||
|
legacy_type(const std::string& n) : number(n) {}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -593,6 +604,8 @@ struct small_pod
|
||||||
struct non_pod
|
struct non_pod
|
||||||
{
|
{
|
||||||
std::string s;
|
std::string s;
|
||||||
|
non_pod() : s() {}
|
||||||
|
non_pod(const std::string& S) : s(S) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename BasicJsonType>
|
template <typename BasicJsonType>
|
||||||
|
|
Loading…
Reference in a new issue