Log
is the class type.
Log::Log
is a syntax construct that in certain contexts refers to Log
's constructor. However it doesn't generally name it as in the names of other functions (e.g. for the purpose of address-taking).
new
expects a type name. That is simply the syntax. Log(...)
in a new-expression like new Log(...)
will call the constructor according to the arguments ...
implicitly to construct the new object, even though Log
is its type name, not referring to its constructor. This is consistent with the syntax for non-class types, such as new int(1)
.
Therefore, remove ::Log
from Log::Log
.
Constructors are never called explicitly in C++. You only have syntax of the form type(...)
or type{...}
which implicitly call constructors for class types to construct new objects. The only case where it might make sense to informally talk about "calling" a constructor might be deferred construction, in which one constructor "calls" another constructor in its member-initializer-list.
I should add that you should not implement a singleton this way. You have no way of destroying the object you created in the new
expression automatically at program end and the initialization is not thread-safe. See e.g. this question and others for C++ singleton designs.