Skip to content

Commit

Permalink
tree: make ctors noexcept. fix warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
biojppm committed Jun 10, 2019
1 parent a9943ae commit a0e27a6
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion extern/c4core
Submodule c4core updated 1 files
+12 −12 src/c4/to_chars.hpp
8 changes: 4 additions & 4 deletions src/c4/yml/tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,24 +97,24 @@ Tree::~Tree()
}


Tree::Tree(Tree const& that) : Tree()
Tree::Tree(Tree const& that) noexcept : Tree()
{
_copy(that);
}

Tree& Tree::operator= (Tree const& that)
Tree& Tree::operator= (Tree const& that) noexcept
{
_free();
_copy(that);
return *this;
}

Tree::Tree(Tree && that) : Tree()
Tree::Tree(Tree && that) noexcept : Tree()
{
_move(that);
}

Tree& Tree::operator= (Tree && that)
Tree& Tree::operator= (Tree && that) noexcept
{
_free();
_move(that);
Expand Down
8 changes: 4 additions & 4 deletions src/c4/yml/tree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,11 +342,11 @@ class Tree

~Tree();

Tree(Tree const& that);
Tree(Tree && that);
Tree(Tree const& that) noexcept;
Tree(Tree && that) noexcept;

Tree& operator= (Tree const& that);
Tree& operator= (Tree && that);
Tree& operator= (Tree const& that) noexcept;
Tree& operator= (Tree && that) noexcept;

public:

Expand Down
2 changes: 1 addition & 1 deletion test/libyaml.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ case YAML_ ## _ev ## _EVENT: \
}
if(loc2 && *loc2)
{
fprintf(stderr, " : %s at %zd:%zd (offset %zd)\n", loc2->name, loc1->line, loc2->col, loc2->offset);
fprintf(stderr, " : %s at %zd:%zd (offset %zd)\n", loc2->name, loc2->line, loc2->col, loc2->offset);
}
throw std::runtime_error(std::string(msg, msg+length));
}
Expand Down
8 changes: 4 additions & 4 deletions test/test_case.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ struct CaseNode

public:

CaseNode(CaseNode && that) { _move(std::move(that)); }
CaseNode(CaseNode const& that) { _copy(that); }
CaseNode(CaseNode && that) noexcept { _move(std::move(that)); }
CaseNode(CaseNode const& that) noexcept { _copy(that); }

CaseNode& operator= (CaseNode && that) { _move(std::move(that)); return *this; }
CaseNode& operator= (CaseNode const& that) { _copy(that); return *this; }
CaseNode& operator= (CaseNode && that) noexcept { _move(std::move(that)); return *this; }
CaseNode& operator= (CaseNode const& that) noexcept { _copy(that); return *this; }

~CaseNode() = default;

Expand Down

0 comments on commit a0e27a6

Please sign in to comment.