So I have this piece of code and out of convenience I want the default parameter for its constructor be of the int kind and 0. (I have more parameters in a class of my project and one of them is optional and I don't want to write the constructor twice because its big)
class mama{
public:
template<typename x> mama(x i=int(0)){}
};
int main(){
mama x;
}
This doesn't work because it says it can't find the constructor so is there another way I can do this?
error: no matching function for call to ‘mama::mama()'
note: candidates are: mama::mama(const mama&)