Declaration:
class ClassOne { ClassOne (ClassTwo* classTwo, ClassThree const& classThree); } 
Test:
 ClassTwo* classTwo; ClassThree classThree; EXPECT_NO_THROW (ClassOne (classTwo, classThree)); 
This compiles and runs, but now I change it to:
Declaration:
 class ClassOne { ClassOne (ClassThree const& classThree); } 
Test:
 ClassThree classThree; EXPECT_NO_THROW (ClassOne (classThree)); 
This does not work with a "suitable default constructor inaccessible."
The following lines are compiled:
 ClassOne classOne (classTwo, classThree); // First case ClassOne classOne (classThree); // Second case 
Is there any reason why I can't EXPECT_NO_THROW for a constructor with one parameter?
user1414883 
source share