Skip to content

Commit 5108786

Browse files
committed
~noexcept
1 parent 354ab6c commit 5108786

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

cpp/core_guidelines.cc

Whitespace-only changes.

cpp/patterns.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,23 +104,23 @@ void associations_demo()
104104
template <typename ValueType>
105105
struct Setter_interface {
106106
virtual void set(ValueType i) = 0;
107-
virtual ~Setter_interface() = default;
107+
virtual ~Setter_interface() noexcept = default;
108108
};
109109

110110
template <typename ValueType>
111111
struct Getter_interface
112112
/// @brief is a sample of getter abstract interface for Synchronized_encapsulated_value
113113
{
114114
virtual ValueType get() const = 0;
115-
virtual ~Getter_interface() = default;
115+
virtual ~Getter_interface() noexcept = default;
116116
};
117117

118118
template <typename ValueType>
119119
struct Change_interface
120120
/// @brief is a sample of changer abstract interface for Synchronized_encapsulated_value
121121
{
122122
virtual void change(ValueType c) = 0;
123-
virtual ~Change_interface() = default;
123+
virtual ~Change_interface() noexcept = default;
124124
};
125125

126126
template <typename ValueType>
@@ -222,7 +222,7 @@ struct Interface
222222
/// @brief is a common pure virtual interface
223223
{
224224
virtual int method() = 0;
225-
virtual ~Interface() = default;
225+
virtual ~Interface() noexcept = default;
226226
};
227227

228228
/**
@@ -467,7 +467,7 @@ struct Observer
467467
virtual void notify() {};
468468
/// @brief with the only Subject argument
469469
virtual void update(Subject& subject) {};
470-
virtual ~Observer() = default;
470+
virtual ~Observer() noexcept = default;
471471
};
472472

473473
struct Subject
@@ -615,7 +615,7 @@ struct Abstract_visitor
615615
{
616616
/// overloaded function for each component subtype
617617
virtual string visit(const Sample_component&) const = 0;
618-
virtual ~Abstract_visitor() = default;
618+
virtual ~Abstract_visitor() noexcept = default;
619619
};
620620

621621
struct Sample_component
@@ -724,7 +724,7 @@ struct Handler
724724
{
725725
/// Specific handler can process a command and return non-negative
726726
virtual int handle(Command& cmnd) { return cmnd.execute(); };
727-
virtual ~Handler() = default;
727+
virtual ~Handler() noexcept = default;
728728
};
729729

730730
struct Chain_of_responsibility
@@ -926,7 +926,8 @@ struct Active_object
926926
}
927927
});
928928
}
929-
~Active_object()
929+
930+
~Active_object() noexcept
930931
{
931932
cmd_q.stop();
932933
th.join();

0 commit comments

Comments
 (0)