I learned that in C++,
typedef foo* mytype;
(mytype) a // C-style cast
and
mytype(a) // function-style cast
The compiler knows. And it calls the constructor when there is one in both cases.
Conversion is a form of initialization. When a type is implicitly convertible to another, a functional cast is a form of direct initialization. The compiler knows which types are convertible.
Whenever something is converted to a class type, either a converting constructor of the target type or a conversion operator of the source type is used. In your examples, both casts call the default constructor.
Syntactically, it is always a cast. That cast may happen to call a constructor:
char s [] = "Hello";
// Function-style cast; internally calls std::basic_string<char>::basic_string(char const*, Allocator)
std::string s2 = std::string(s);
// C-style cast; internally calls std::basic_string<char>::basic_string(char const*, Allocator)
std::string s3 = (std::string) s;