Skip to content

Commit cdd04d6

Browse files
burblebeetkoeppe
authored andcommitted
LWG3724 decay-copy should be constrained
1 parent c519b70 commit cdd04d6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

source/lib-intro.tex

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -492,9 +492,11 @@
492492
\indexlibrary{decay-copy@\tcode{\placeholder{decay-copy}}}%
493493
\begin{codeblock}
494494
namespace std {
495-
template<class T> constexpr decay_t<T> @\placeholdernc{decay-copy}@(T&& v)
496-
noexcept(is_nothrow_convertible_v<T, decay_t<T>>) // \expos
497-
{ return std::forward<T>(v); }
495+
template<class T>
496+
requires @\libconcept{convertible_to}@<T, decay_t<T>>
497+
constexpr decay_t<T> @\placeholdernc{decay-copy}@(T&& v)
498+
noexcept(is_nothrow_convertible_v<T, decay_t<T>>) // \expos
499+
{ return std::forward<T>(v); }
498500

499501
constexpr auto @\placeholdernc{synth-three-way}@ =
500502
[]<class T, class U>(const T& t, const U& u)

0 commit comments

Comments
 (0)