#include #include template concept CommonWith = std::common_with; template requires CommonWith void fun2(T1 &&t1, T2 &&t2) {} //commonref template concept CommonRef = std::common_reference_with; template requires CommonRef void fun(T1 &&t1, T2 &&t2) {} struct B {}; struct D1: public B { }; int main() { fun(4, 'a'); fun(4.5, 'a'); D1 d1; B b; fun(b, d1); // objects, rvalue refs: fun(D1{}, B{}); // all OK } //=