I have an interface as follows:
struct TestInterface
{
void on_read(unsigned len, const char* buf);
};
My attempt at expressing this as a concept is as follows:
template<class T>
concept TestConcept = requires(T a)
{
{ a.on_read(unsigned, const char*) } -> void;
};
However, this does not compile. What is the correct syntax for this?
Errors I am getting are:
error: expected primary-expression before ‘unsigned’
error: expected primary-expression before ‘const’
error: return-type-requirement is not a type-constraint
As a side question, is there a way to enforce public / private members when declaring concepts?
This question might be too basic, please guide me.