Skip to content

Commit 8a0e3d8

Browse files
authored
fix: direct-init const ref instead of list-init (#1175)
fixes: #1162 gcc has a bug that generates a call to the copy constructor when list initializing a const reference. This PR offers a workaround which is to direct initialize the value. see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117900
1 parent aed09c4 commit 8a0e3d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/gsl/pointers

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public:
117117
not_null(const not_null& other) = default;
118118
not_null& operator=(const not_null& other) = default;
119119
constexpr details::value_or_reference_return_t<T> get() const
120-
noexcept(noexcept(details::value_or_reference_return_t<T>{std::declval<T&>()}))
120+
noexcept(noexcept(details::value_or_reference_return_t<T>(std::declval<T&>())))
121121
{
122122
return ptr_;
123123
}

0 commit comments

Comments
 (0)