When designing a public API, is it a good practice to make the constructor as explicit?
class A {
public:
//explicit A(int i){}
A(int i){}
};
void fun(const A& a) {}
int main() {
// If I use explicit for A constructor, I can prevent this mistake.
// (Or shall I call it as feature?)
fun(10);
}
Or shall I allow implicit conversion, to allow user to call my API with less typing?