C++ explicit constructor that takes a pointer
This question already has an answer here:
The following code:
void f(Foo) {}
int main()
{
int* p;
f(p);
}
Fails to compile with explicit
.
Happily compiles without it.
live example on godbolt.org
链接地址: http://www.djcxy.com/p/24560.html上一篇: C ++显式构造器的应用
下一篇: C ++显式构造函数,需要一个指针