Skip to content

Commit

Permalink
add noexcept to all methods in demo classes
Browse files Browse the repository at this point in the history
  • Loading branch information
daixtrose committed Oct 16, 2024
1 parent d9d524a commit b21206d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions polymorphism/include/polymorphism/impl_with_interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class Impl
std::string s_ { "<default value>" }; // with default member initializer (C++11)

public:
std::string coolFeature() const override { return s_; }
void set(std::string s) override
std::string coolFeature() const noexcept override { return s_; }
void set(std::string s) noexcept override
{
s_ = std::move(s);
}
Expand Down
4 changes: 2 additions & 2 deletions polymorphism/include/polymorphism/impl_without_interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class Impl {
std::string s_ { "<default value>" }; // with default member initializer (C++11)

public:
std::string coolFeature() const { return s_; }
void set(std::string s)
std::string coolFeature() const noexcept { return s_; }
void set(std::string s) noexcept
{
s_ = std::move(s);
}
Expand Down

0 comments on commit b21206d

Please sign in to comment.