#include <iostream>
using namespace std;
class Abstract{
virtual void method () = 0;
public:
Abstract(int a){};
};
int main() {
Abstract a;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY2xhc3MgQWJzdHJhY3R7Cgl2aXJ0dWFsIHZvaWQgbWV0aG9kICgpID0gMDsKcHVibGljOgoJQWJzdHJhY3QoaW50IGEpe307Cn07CgppbnQgbWFpbigpIHsKCUFic3RyYWN0IGE7CglyZXR1cm4gMDsKfQ==
prog.cpp: In function ‘int main()’:
prog.cpp:11:11: error: no matching function for call to ‘Abstract::Abstract()’
Abstract a;
^
prog.cpp:11:11: note: candidates are:
prog.cpp:7:2: note: Abstract::Abstract(int)
Abstract(int a){};
^
prog.cpp:7:2: note: candidate expects 1 argument, 0 provided
prog.cpp:4:7: note: constexpr Abstract::Abstract(const Abstract&)
class Abstract{
^
prog.cpp:4:7: note: candidate expects 1 argument, 0 provided
prog.cpp:4:7: note: constexpr Abstract::Abstract(Abstract&&)
prog.cpp:4:7: note: candidate expects 1 argument, 0 provided
prog.cpp:11:11: error: cannot declare variable ‘a’ to be of abstract type ‘Abstract’
Abstract a;
^
prog.cpp:4:7: note: because the following virtual functions are pure within ‘Abstract’:
class Abstract{
^
prog.cpp:5:15: note: virtual void Abstract::method()
virtual void method () = 0;
^