An implicit default constructor is a default constructor which is implicitly created by the compiler when there are no other constructors defined. An implicit default constructor is an empty body constructor, with no arguments and do not initialize anything. For example,
#include <iostream>
class Point
{
int m_x{};
int m_y{};
public:
void print() const
{
std::cout << "{" << m_x << ", " << m_y << "}\n";
}
};
int main(int argc, char const *argv[])
{
Point{}.print();
return 0;
}Compiler creates implicit default constructors as shown below,
Point(){} // default constructorThis is helpful when the class is empty and there is no use of creating constructors.