Does the following code requires an implicit copy constructor for T, because the parameters are passed by value? Or does it behave like decltype and there's no real construction involved?
template<typename T>
concept Addable = requires (T a, T b){ a + b; };
That concept simply checks that
a + bis a valid expression. Theaandbthere are simply invented objects that are lvalues of typeT- they are not at all constructed.If the expression
a + b, based on howoperator+is defined, results in copying, then that copy will also be checked as part of seeing if the expression is valid. But otherwise, no.For instance: