Код: Выделить всё
class Foo1
{
std::string name;
static void dosomething() {}
};
template
void some_function(T& obj) {
constexpr bool result = requires { T::name; };
static_assert(result);
}
int main(int argc, char* argv[])
{
Foo1 f;
some_function(f);
}
Подробнее здесь: https://stackoverflow.com/questions/797 ... mpile-this
Мобильная версия