Skip to content

Commit 4f9efaa

Browse files
committed
Fix wrong examples in [meta.detect]
It's `is_detected<Op, Args...>`, so `copy_assign_t` first, then `T`. Similarly, it's `is_detected_exact<Expected, Op, Args...>`, so `T&`, then `copy_assign_t`, then `T`.
1 parent a1decaa commit 4f9efaa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: utilities.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -455,12 +455,12 @@ <h1>Detection idiom</h1>
455455

456456
// <i>plausible implementation for the is_assignable type trait:</i>
457457
template &lt;class T>
458-
using is_copy_assignable = is_detected&lt;T, copy_assign_t>;
458+
using is_copy_assignable = is_detected&lt;copy_assign_t, T>;
459459

460460
// <i>plausible implementation for an augmented is_assignable type trait</i>
461461
// <i>that also checks the return type:</i>
462462
template &lt;class T>
463-
using is_canonical_copy_assignable = is_detected_exact&lt;T&, T, copy_assign_t>;</code></pre>
463+
using is_canonical_copy_assignable = is_detected_exact&lt;T&, copy_assign_t, T>;</code></pre>
464464
</cxx-example>
465465

466466
<cxx-example>

0 commit comments

Comments
 (0)