https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91405

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Something like:

template<typename T>
constexpr bool is_void_v = false;
template<>
constexpr bool is_void_v<void> = true;

template<typename T>
concept Void = is_void_v<T>;

template<typename T>
concept DatabaseTransaction = requires(T a) {
{ a.commit() } -> Void;
};

template<typename T>
concept UserRepository = requires(T a, DatabaseTransaction auto transaction) {
{ a.insert_user_if_not_exists(transaction) } -> Void;
};

which correctly says:

91405.cc:15:60: error: placeholder type not allowed in this context
   15 | concept UserRepository = requires(T a, DatabaseTransaction auto
transaction) {
      |                                                            ^~~~

Reply via email to