Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
yaml-cpp
Commits
a6ed66ab
Commit
a6ed66ab
authored
Oct 02, 2019
by
Andy Maloney
Committed by
Jesse Beder
Oct 02, 2019
Browse files
Modernize: Use "default" for destructors and copy constructors (#751)
parent
e6b3a92e
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
29 additions
and
34 deletions
+29
-34
include/yaml-cpp/eventhandler.h
include/yaml-cpp/eventhandler.h
+1
-1
include/yaml-cpp/exceptions.h
include/yaml-cpp/exceptions.h
+1
-1
include/yaml-cpp/node/impl.h
include/yaml-cpp/node/impl.h
+2
-6
include/yaml-cpp/node/iterator.h
include/yaml-cpp/node/iterator.h
+1
-1
src/emitter.cpp
src/emitter.cpp
+1
-1
src/emitterstate.cpp
src/emitterstate.cpp
+1
-1
src/exceptions.cpp
src/exceptions.cpp
+13
-13
src/nodebuilder.cpp
src/nodebuilder.cpp
+1
-1
src/ostream_wrapper.cpp
src/ostream_wrapper.cpp
+1
-1
src/parser.cpp
src/parser.cpp
+1
-1
src/regex_yaml.h
src/regex_yaml.h
+1
-1
src/scanner.cpp
src/scanner.cpp
+1
-1
src/setting.h
src/setting.h
+1
-1
src/singledocparser.cpp
src/singledocparser.cpp
+1
-1
src/streamcharsource.h
src/streamcharsource.h
+2
-3
No files found.
include/yaml-cpp/eventhandler.h
View file @
a6ed66ab
...
...
@@ -17,7 +17,7 @@ struct Mark;
class
EventHandler
{
public:
virtual
~
EventHandler
()
{}
virtual
~
EventHandler
()
=
default
;
virtual
void
OnDocumentStart
(
const
Mark
&
mark
)
=
0
;
virtual
void
OnDocumentEnd
()
=
0
;
...
...
include/yaml-cpp/exceptions.h
View file @
a6ed66ab
...
...
@@ -210,7 +210,7 @@ class YAML_CPP_API TypedKeyNotFound : public KeyNotFound {
public:
TypedKeyNotFound
(
const
Mark
&
mark_
,
const
T
&
key_
)
:
KeyNotFound
(
mark_
,
key_
),
key
(
key_
)
{}
virtual
~
TypedKeyNotFound
()
YAML_CPP_NOEXCEPT
{}
virtual
~
TypedKeyNotFound
()
YAML_CPP_NOEXCEPT
=
default
;
T
key
;
};
...
...
include/yaml-cpp/node/impl.h
View file @
a6ed66ab
...
...
@@ -42,11 +42,7 @@ inline Node::Node(const detail::iterator_value& rhs)
m_pMemory
(
rhs
.
m_pMemory
),
m_pNode
(
rhs
.
m_pNode
)
{}
inline
Node
::
Node
(
const
Node
&
rhs
)
:
m_isValid
(
rhs
.
m_isValid
),
m_invalidKey
(
rhs
.
m_invalidKey
),
m_pMemory
(
rhs
.
m_pMemory
),
m_pNode
(
rhs
.
m_pNode
)
{}
inline
Node
::
Node
(
const
Node
&
rhs
)
=
default
;
inline
Node
::
Node
(
Zombie
)
:
m_isValid
(
false
),
m_invalidKey
{},
m_pMemory
{},
m_pNode
(
nullptr
)
{}
...
...
@@ -57,7 +53,7 @@ inline Node::Node(Zombie, const std::string& key)
inline
Node
::
Node
(
detail
::
node
&
node
,
detail
::
shared_memory_holder
pMemory
)
:
m_isValid
(
true
),
m_invalidKey
{},
m_pMemory
(
pMemory
),
m_pNode
(
&
node
)
{}
inline
Node
::~
Node
()
{}
inline
Node
::~
Node
()
=
default
;
inline
void
Node
::
EnsureNodeExists
()
const
{
if
(
!
m_isValid
)
...
...
include/yaml-cpp/node/iterator.h
View file @
a6ed66ab
...
...
@@ -18,7 +18,7 @@
namespace
YAML
{
namespace
detail
{
struct
iterator_value
:
public
Node
,
std
::
pair
<
Node
,
Node
>
{
iterator_value
()
{}
iterator_value
()
=
default
;
explicit
iterator_value
(
const
Node
&
rhs
)
:
Node
(
rhs
),
std
::
pair
<
Node
,
Node
>
(
Node
(
Node
::
ZombieNode
),
Node
(
Node
::
ZombieNode
))
{}
...
...
src/emitter.cpp
View file @
a6ed66ab
...
...
@@ -16,7 +16,7 @@ Emitter::Emitter() : m_pState(new EmitterState), m_stream{} {}
Emitter
::
Emitter
(
std
::
ostream
&
stream
)
:
m_pState
(
new
EmitterState
),
m_stream
(
stream
)
{}
Emitter
::~
Emitter
()
{}
Emitter
::~
Emitter
()
=
default
;
const
char
*
Emitter
::
c_str
()
const
{
return
m_stream
.
str
();
}
...
...
src/emitterstate.cpp
View file @
a6ed66ab
...
...
@@ -32,7 +32,7 @@ EmitterState::EmitterState()
m_hasNonContent
(
false
),
m_docCount
(
0
)
{}
EmitterState
::~
EmitterState
()
{}
EmitterState
::~
EmitterState
()
=
default
;
// SetLocalValue
// . We blindly tries to set all possible formatters to this value
...
...
src/exceptions.cpp
View file @
a6ed66ab
...
...
@@ -11,19 +11,19 @@
namespace
YAML
{
// These destructors are defined out-of-line so the vtable is only emitted once.
Exception
::~
Exception
()
YAML_CPP_NOEXCEPT
{}
ParserException
::~
ParserException
()
YAML_CPP_NOEXCEPT
{}
RepresentationException
::~
RepresentationException
()
YAML_CPP_NOEXCEPT
{}
InvalidScalar
::~
InvalidScalar
()
YAML_CPP_NOEXCEPT
{}
KeyNotFound
::~
KeyNotFound
()
YAML_CPP_NOEXCEPT
{}
InvalidNode
::~
InvalidNode
()
YAML_CPP_NOEXCEPT
{}
BadConversion
::~
BadConversion
()
YAML_CPP_NOEXCEPT
{}
BadDereference
::~
BadDereference
()
YAML_CPP_NOEXCEPT
{}
BadSubscript
::~
BadSubscript
()
YAML_CPP_NOEXCEPT
{}
BadPushback
::~
BadPushback
()
YAML_CPP_NOEXCEPT
{}
BadInsert
::~
BadInsert
()
YAML_CPP_NOEXCEPT
{}
EmitterException
::~
EmitterException
()
YAML_CPP_NOEXCEPT
{}
BadFile
::~
BadFile
()
YAML_CPP_NOEXCEPT
{}
Exception
::~
Exception
()
YAML_CPP_NOEXCEPT
=
default
;
ParserException
::~
ParserException
()
YAML_CPP_NOEXCEPT
=
default
;
RepresentationException
::~
RepresentationException
()
YAML_CPP_NOEXCEPT
=
default
;
InvalidScalar
::~
InvalidScalar
()
YAML_CPP_NOEXCEPT
=
default
;
KeyNotFound
::~
KeyNotFound
()
YAML_CPP_NOEXCEPT
=
default
;
InvalidNode
::~
InvalidNode
()
YAML_CPP_NOEXCEPT
=
default
;
BadConversion
::~
BadConversion
()
YAML_CPP_NOEXCEPT
=
default
;
BadDereference
::~
BadDereference
()
YAML_CPP_NOEXCEPT
=
default
;
BadSubscript
::~
BadSubscript
()
YAML_CPP_NOEXCEPT
=
default
;
BadPushback
::~
BadPushback
()
YAML_CPP_NOEXCEPT
=
default
;
BadInsert
::~
BadInsert
()
YAML_CPP_NOEXCEPT
=
default
;
EmitterException
::~
EmitterException
()
YAML_CPP_NOEXCEPT
=
default
;
BadFile
::~
BadFile
()
YAML_CPP_NOEXCEPT
=
default
;
}
#undef YAML_CPP_NOEXCEPT
...
...
src/nodebuilder.cpp
View file @
a6ed66ab
...
...
@@ -19,7 +19,7 @@ NodeBuilder::NodeBuilder()
m_anchors
.
push_back
(
nullptr
);
// since the anchors start at 1
}
NodeBuilder
::~
NodeBuilder
()
{}
NodeBuilder
::~
NodeBuilder
()
=
default
;
Node
NodeBuilder
::
Root
()
{
if
(
!
m_pRoot
)
...
...
src/ostream_wrapper.cpp
View file @
a6ed66ab
...
...
@@ -21,7 +21,7 @@ ostream_wrapper::ostream_wrapper(std::ostream& stream)
m_col
(
0
),
m_comment
(
false
)
{}
ostream_wrapper
::~
ostream_wrapper
()
{}
ostream_wrapper
::~
ostream_wrapper
()
=
default
;
void
ostream_wrapper
::
write
(
const
std
::
string
&
str
)
{
if
(
m_pStream
)
{
...
...
src/parser.cpp
View file @
a6ed66ab
...
...
@@ -15,7 +15,7 @@ Parser::Parser() : m_pScanner{}, m_pDirectives{} {}
Parser
::
Parser
(
std
::
istream
&
in
)
:
Parser
()
{
Load
(
in
);
}
Parser
::~
Parser
()
{}
Parser
::~
Parser
()
=
default
;
Parser
::
operator
bool
()
const
{
return
m_pScanner
.
get
()
&&
!
m_pScanner
->
empty
();
...
...
src/regex_yaml.h
View file @
a6ed66ab
...
...
@@ -34,7 +34,7 @@ class YAML_CPP_API RegEx {
explicit
RegEx
(
char
ch
);
RegEx
(
char
a
,
char
z
);
RegEx
(
const
std
::
string
&
str
,
REGEX_OP
op
=
REGEX_SEQ
);
~
RegEx
()
{}
~
RegEx
()
=
default
;
friend
YAML_CPP_API
RegEx
operator
!
(
const
RegEx
&
ex
);
friend
YAML_CPP_API
RegEx
operator
|
(
const
RegEx
&
ex1
,
const
RegEx
&
ex2
);
...
...
src/scanner.cpp
View file @
a6ed66ab
...
...
@@ -19,7 +19,7 @@ Scanner::Scanner(std::istream& in)
m_indentRefs
{},
m_flows
{}
{}
Scanner
::~
Scanner
()
{}
Scanner
::~
Scanner
()
=
default
;
bool
Scanner
::
empty
()
{
EnsureTokensInQueue
();
...
...
src/setting.h
View file @
a6ed66ab
...
...
@@ -30,7 +30,7 @@ class Setting {
class
SettingChangeBase
{
public:
virtual
~
SettingChangeBase
()
{}
virtual
~
SettingChangeBase
()
=
default
;
virtual
void
pop
()
=
0
;
};
...
...
src/singledocparser.cpp
View file @
a6ed66ab
...
...
@@ -21,7 +21,7 @@ SingleDocParser::SingleDocParser(Scanner& scanner, const Directives& directives)
m_anchors
{},
m_curAnchor
(
0
)
{}
SingleDocParser
::~
SingleDocParser
()
{}
SingleDocParser
::~
SingleDocParser
()
=
default
;
// HandleDocument
// . Handles the next document
...
...
src/streamcharsource.h
View file @
a6ed66ab
...
...
@@ -13,12 +13,11 @@ namespace YAML {
class
StreamCharSource
{
public:
StreamCharSource
(
const
Stream
&
stream
)
:
m_offset
(
0
),
m_stream
(
stream
)
{}
StreamCharSource
(
const
StreamCharSource
&
source
)
:
m_offset
(
source
.
m_offset
),
m_stream
(
source
.
m_stream
)
{}
StreamCharSource
(
const
StreamCharSource
&
source
)
=
default
;
StreamCharSource
(
StreamCharSource
&&
)
=
default
;
StreamCharSource
&
operator
=
(
const
StreamCharSource
&
)
=
delete
;
StreamCharSource
&
operator
=
(
StreamCharSource
&&
)
=
delete
;
~
StreamCharSource
()
{}
~
StreamCharSource
()
=
default
;
operator
bool
()
const
;
char
operator
[](
std
::
size_t
i
)
const
{
return
m_stream
.
CharAt
(
m_offset
+
i
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment