I found out that in C ++,
typedef foo* mytype;
(mytype) a
and
mytype(a) // function-style cast
do the same thing.
But I notice that the style function uses the general syntax as a constructor.
Are there any ambiguous cases when we do not know if this is a throw or a constructor?
char s [] = "Hello";
std::string s2 = std::string(s);
std::string s3 = (std::string) s;
source
share