#include <iostream>
#include <type_traits>
using namespace std;
// Variant 1:
class I1 {
public:
virtual ~I1() {}
};
// Variant 2.1:
class I21 {
public:
virtual ~I21() = 0;
};
I21::~I21() {}
// Variant 2.2:
class I22 {
public:
virtual ~I22() = 0;
};
I22::~I22() = default;
int main() {
cout << boolalpha << "std::is_abstract:\n";
cout << "I1: " << std::is_abstract<I1>::value << '\n';
cout << "I21: " << std::is_abstract<I21>::value << '\n';
cout << "I22: " << std::is_abstract<I22>::value << '\n';
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dHlwZV90cmFpdHM+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKLy8gVmFyaWFudCAxOgoKY2xhc3MgSTEgewpwdWJsaWM6CiAgICB2aXJ0dWFsIH5JMSgpIHt9Cn07CgovLyBWYXJpYW50IDIuMToKCmNsYXNzIEkyMSB7CnB1YmxpYzoKICAgIHZpcnR1YWwgfkkyMSgpID0gMDsKfTsKCkkyMTo6fkkyMSgpIHt9CgovLyBWYXJpYW50IDIuMjoKCmNsYXNzIEkyMiB7CnB1YmxpYzoKICAgIHZpcnR1YWwgfkkyMigpID0gMDsKfTsKCkkyMjo6fkkyMigpID0gZGVmYXVsdDsKCmludCBtYWluKCkgewoJY291dCA8PCBib29sYWxwaGEgPDwgInN0ZDo6aXNfYWJzdHJhY3Q6XG4iOyAKCQoJY291dCA8PCAiSTE6ICAiIDw8IHN0ZDo6aXNfYWJzdHJhY3Q8STE+Ojp2YWx1ZSA8PCAnXG4nOwoJY291dCA8PCAiSTIxOiAiIDw8IHN0ZDo6aXNfYWJzdHJhY3Q8STIxPjo6dmFsdWUgPDwgJ1xuJzsKCWNvdXQgPDwgIkkyMjogIiA8PCBzdGQ6OmlzX2Fic3RyYWN0PEkyMj46OnZhbHVlIDw8ICdcbic7CgoJcmV0dXJuIDA7Cn0=