Код: Выделить всё
#include
template
concept Printable = requires(T obj) {
{ obj.print() } -> std::same_as;
};
template
void func(const T& obj)
{
obj.print();
}
class Foo
{
private:
void print() const { /* std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79663318/is-this-concept-satisfaction-a-bug-in-gcc-or-did-i-invoke-undefined-behavior[/url]
Мобильная версия