Ignores the cppcheck warnings about missing explicit keywords on constructor with one parameter in json_ref.hpp.

This commit is contained in:
Xav83 2019-12-20 21:29:08 +01:00
parent edef01a64f
commit 67b8c21a78
2 changed files with 8 additions and 0 deletions

View File

@ -15,14 +15,17 @@ class json_ref
public:
using value_type = BasicJsonType;
// cppcheck-suppress noExplicitConstructor
json_ref(value_type&& value)
: owned_value(std::move(value)), value_ref(&owned_value), is_rvalue(true)
{}
// cppcheck-suppress noExplicitConstructor
json_ref(const value_type& value)
: value_ref(const_cast<value_type*>(&value)), is_rvalue(false)
{}
// cppcheck-suppress noExplicitConstructor
json_ref(std::initializer_list<json_ref> init)
: owned_value(init), value_ref(&owned_value), is_rvalue(true)
{}
@ -30,6 +33,7 @@ class json_ref
template <
class... Args,
enable_if_t<std::is_constructible<value_type, Args...>::value, int> = 0 >
// cppcheck-suppress noExplicitConstructor
json_ref(Args && ... args)
: owned_value(std::forward<Args>(args)...), value_ref(&owned_value),
is_rvalue(true) {}

View File

@ -11103,14 +11103,17 @@ class json_ref
public:
using value_type = BasicJsonType;
// cppcheck-suppress noExplicitConstructor
json_ref(value_type&& value)
: owned_value(std::move(value)), value_ref(&owned_value), is_rvalue(true)
{}
// cppcheck-suppress noExplicitConstructor
json_ref(const value_type& value)
: value_ref(const_cast<value_type*>(&value)), is_rvalue(false)
{}
// cppcheck-suppress noExplicitConstructor
json_ref(std::initializer_list<json_ref> init)
: owned_value(init), value_ref(&owned_value), is_rvalue(true)
{}
@ -11118,6 +11121,7 @@ class json_ref
template <
class... Args,
enable_if_t<std::is_constructible<value_type, Args...>::value, int> = 0 >
// cppcheck-suppress noExplicitConstructor
json_ref(Args && ... args)
: owned_value(std::forward<Args>(args)...), value_ref(&owned_value),
is_rvalue(true) {}