How can we convert the requirements In this question link to a concept
I have attempted the following:
template< typename U, typename Tin, typename Tout>
concept MyConditions =
(
U::value_type
&& Tin::value_type
&& Tout::value_type
&& std::is_floating_point_v<typename Tin::value_type>
&& std::is_integral_v<typename U::value_type>
&& std::is_floating_point_v<typename Tout::value_type>
);
This concept is now applied to one of my member functions:
class test_concept
{
template< typename U, typename Tin, typename Tout>
requires MyConditions <U, Tin, Tout>
static void test_routine(const U&, const Tin&, Tout& );
}
When testing:
std::vector<double> test{ };
std::vector<int> testi{ };
std::vector<double> test2{ };
test_concept::test_routine(testi, test, test2);
Using clang
I get the error message that no matching were found, and a note saying:
note: because substituted constraint expression is ill-formed: missing 'typename' prior to dependent type name 'vector<int, allocator >::value_type' U::value_type