This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/67324] Failures in Assignable concept's requires-expression
- From: "Casey at Carter dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 01 Sep 2015 17:48:36 +0000
- Subject: [Bug c++/67324] Failures in Assignable concept's requires-expression
- Auto-submitted: auto-generated
- References: <bug-67324-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67324
Casey Carter <Casey at Carter dot net> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |Casey at Carter dot net
--- Comment #1 from Casey Carter <Casey at Carter dot net> ---
> template< class T, class U = T >
> concept bool
> Assignable( )
> {
> return
> requires( T&& a, U&& b ) {
> //{ forward<T>(a) = forward<U>(b) } -> Same<T&>; // #1
> //Same<T&, decltype(forward<T>(a) = forward<U>(b))>(); // #2
> };
> }
#2 is an expression constraint requiring "Same<...>()" to be a valid
expression. It notably does NOT require "Same<...>()" to be satisfied. You need
a nested-requirement to express this:
template< class T, class U = T >
concept bool
Assignable()
{
return
requires( T&& a, U&& b ) {
requires Same<T&, decltype(forward<T>(a) = forward<U>(b))>();
};
}