Код: Выделить всё
// Example program
#include
#include
namespace bar
{
template
concept has_foo = std::same_as;
}
namespace my
{
struct Foo{};
}
namespace bar
{
consteval std::true_type enable_foo(my::Foo);
}
int main()
{
bool const enable_foo_ = std::same_as;
bool const has_foo_ = bar::has_foo;
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79867651/when-and-where-are-c-concepts-instantiated[/url]
Мобильная версия