Skip to content

Commit b21206d

Browse files
committed
add noexcept to all methods in demo classes
1 parent d9d524a commit b21206d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

polymorphism/include/polymorphism/impl_with_interface.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ class Impl
1414
std::string s_ { "<default value>" }; // with default member initializer (C++11)
1515

1616
public:
17-
std::string coolFeature() const override { return s_; }
18-
void set(std::string s) override
17+
std::string coolFeature() const noexcept override { return s_; }
18+
void set(std::string s) noexcept override
1919
{
2020
s_ = std::move(s);
2121
}

polymorphism/include/polymorphism/impl_without_interface.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ class Impl {
1212
std::string s_ { "<default value>" }; // with default member initializer (C++11)
1313

1414
public:
15-
std::string coolFeature() const { return s_; }
16-
void set(std::string s)
15+
std::string coolFeature() const noexcept { return s_; }
16+
void set(std::string s) noexcept
1717
{
1818
s_ = std::move(s);
1919
}

0 commit comments

Comments
 (0)