Код: Выделить всё
template
concept has_set = requires(T t, std::string s) {
{ t.set(s) } -> std::same_as; };
};
Код: Выделить всё
template
concept has_set = requires(T t, std::convertible_to s) {
{ t.set(s) } -> std::same_as; };
};
Подробнее здесь: https://stackoverflow.com/questions/791 ... -a-concept
Мобильная версия