#include <iostream>
using namespace std;
class test{
public:
test(int a/* = 1*/) : a_(a) {}
int get() const { return a_; }
private:
int a_;
};
int main() {
test t;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY2xhc3MgdGVzdHsKCXB1YmxpYzoKCXRlc3QoaW50IGEvKiA9IDEqLykgOiBhXyhhKSB7fQoJaW50IGdldCgpIGNvbnN0IHsgcmV0dXJuIGFfOyB9Cglwcml2YXRlOgoJaW50IGFfOwp9OwoKCmludCBtYWluKCkgewoJdGVzdCB0OwoJcmV0dXJuIDA7Cn0K
prog.cpp: In function ‘int main()’:
prog.cpp:14:7: error: no matching function for call to ‘test::test()’
test t;
^
prog.cpp:6:2: note: candidate: ‘test::test(int)’
test(int a/* = 1*/) : a_(a) {}
^~~~
prog.cpp:6:2: note: candidate expects 1 argument, 0 provided
prog.cpp:4:7: note: candidate: ‘constexpr test::test(const test&)’
class test{
^~~~
prog.cpp:4:7: note: candidate expects 1 argument, 0 provided
prog.cpp:4:7: note: candidate: ‘constexpr test::test(test&&)’
prog.cpp:4:7: note: candidate expects 1 argument, 0 provided