Skip to content

Commit 21dfd5d

Browse files
noexcept for strongid methods
1 parent d2af592 commit 21dfd5d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

libs/libvtrutil/src/vtr_strong_id.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,10 @@ class StrongId;
160160
* friend them
161161
*/
162162
template<typename tag, typename T, T sentinel>
163-
constexpr bool operator==(const StrongId<tag, T, sentinel>& lhs, const StrongId<tag, T, sentinel>& rhs);
163+
constexpr bool operator==(const StrongId<tag, T, sentinel>& lhs, const StrongId<tag, T, sentinel>& rhs) noexcept;
164164

165165
template<typename tag, typename T, T sentinel>
166-
constexpr bool operator!=(const StrongId<tag, T, sentinel>& lhs, const StrongId<tag, T, sentinel>& rhs);
166+
constexpr bool operator!=(const StrongId<tag, T, sentinel>& lhs, const StrongId<tag, T, sentinel>& rhs) noexcept;
167167

168168
template<typename tag, typename T, T sentinel>
169169
constexpr bool operator<(const StrongId<tag, T, sentinel>& lhs, const StrongId<tag, T, sentinel>& rhs) noexcept;
@@ -211,9 +211,9 @@ class StrongId {
211211
* Note that since these are templated functions we provide an empty set of template parameters
212212
* after the function name (i.e. <>)
213213
*/
214-
friend constexpr bool operator== <>(const StrongId<tag, T, sentinel>& lhs, const StrongId<tag, T, sentinel>& rhs);
214+
friend constexpr bool operator== <>(const StrongId<tag, T, sentinel>& lhs, const StrongId<tag, T, sentinel>& rhs) noexcept;
215215
///@brief != operator
216-
friend constexpr bool operator!= <>(const StrongId<tag, T, sentinel>& lhs, const StrongId<tag, T, sentinel>& rhs);
216+
friend constexpr bool operator!= <>(const StrongId<tag, T, sentinel>& lhs, const StrongId<tag, T, sentinel>& rhs) noexcept;
217217
///@brief < operator
218218
friend constexpr bool operator< <>(const StrongId<tag, T, sentinel>& lhs, const StrongId<tag, T, sentinel>& rhs) noexcept;
219219

@@ -228,13 +228,13 @@ class StrongId {
228228

229229
///@brief == operator
230230
template<typename tag, typename T, T sentinel>
231-
constexpr bool operator==(const StrongId<tag, T, sentinel>& lhs, const StrongId<tag, T, sentinel>& rhs) {
231+
constexpr bool operator==(const StrongId<tag, T, sentinel>& lhs, const StrongId<tag, T, sentinel>& rhs) noexcept {
232232
return lhs.id_ == rhs.id_;
233233
}
234234

235235
///@brief != operator
236236
template<typename tag, typename T, T sentinel>
237-
constexpr bool operator!=(const StrongId<tag, T, sentinel>& lhs, const StrongId<tag, T, sentinel>& rhs) {
237+
constexpr bool operator!=(const StrongId<tag, T, sentinel>& lhs, const StrongId<tag, T, sentinel>& rhs) noexcept {
238238
return !(lhs == rhs);
239239
}
240240

0 commit comments

Comments
 (0)