On Mon, 18 Apr 2022 at 09:08, Marios Staikopoulos via Std-Discussion <std-discussion@lists.isocpp.org> wrote:
```

template<typename T, typename B>

concept EncryptionKey = requires(const T key, B& buf, const B& c_buf)

{

               requires Buffer<B>;

 

               { key.EncryptFast(buf) } -> std::same_as<bool>;

               { key.EncryptFast(buf, c_buf) } -> std::same_as<bool>;

};

```

... but what about this:


```
template<Buffer B1, Buffer B2, Encryptionkey<???> K>
void EncryptBufferHelper(B1& buf1, const B2& buf2, const K& key)
{
               key.EncryptFast<B1, B2>(buf1, buf2);
}
```


Maybe something like:

```
template<Buffer B, typename K>
requires EncryptionKey<K, B>
void EncryptBufferHelper(B& buf1, const B& buf2, const K& key)
{
               key.EncryptFast(buf1, buf2);
}
```

The shorthand notation (`Concept Type` within angle brackets) cannot be used for multi-parameter concepts, and one generally needs to use the requires clause instead.

Best regards,

Yongwei