Skip to content

Commit

Permalink
Make qsbr_ptr::operator* and friend operator+(difference_type, qsbr_p…
Browse files Browse the repository at this point in the history
…tr) noexcept

At the same time add IYWU=ON to CMake presets, where it was missing since IWYU
split from MAINTAINER_MODE
  • Loading branch information
laurynas-biveinis committed Jan 16, 2025
1 parent da4aacb commit fe1692f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"STANDALONE": "ON",
"MAINTAINER_MODE": "ON"
"MAINTAINER_MODE": "ON",
"IWYU": "ON"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions qsbr_ptr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class [[nodiscard]] qsbr_ptr : public detail::qsbr_ptr_base {
UNODB_DETAIL_RESTORE_MSVC_WARNINGS()
UNODB_DETAIL_RESTORE_MSVC_WARNINGS()

[[nodiscard]] constexpr reference operator*() const { return *ptr; }
[[nodiscard]] constexpr reference operator*() const noexcept { return *ptr; }

[[nodiscard]] constexpr reference operator[](
difference_type n) const noexcept {
Expand Down Expand Up @@ -170,7 +170,7 @@ class [[nodiscard]] qsbr_ptr : public detail::qsbr_ptr_base {
}

[[nodiscard]] friend constexpr qsbr_ptr operator+(difference_type n,
qsbr_ptr other) {
qsbr_ptr other) noexcept {
return other + n;
}

Expand Down

0 comments on commit fe1692f

Please sign in to comment.