Possible Duplicate:
What does the explicit keyword in C++ mean?
explicit CImg(const char *const filename):_width(0),_height(0),_depth(0),_spectrum(0),_is_shared(false),_data(0) {
assign(filename);
}
what’s the difference with or without it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s use to decorate constructors; a constructor so decorated cannot be used by the compiler for implicit conversions.
C++ allows up to one user-provided conversion, where “user-provided” means, “by means of a class constructor”, e.g., in :
the compiler will call the circle ctor here, constructinmg circle
cwith a value of 3 forr.explicitis used when you don’t want this. Adding explicit means that you’d have to explicitly construct: