explicit
can be used on eg. a constructor or conversion function to avoid implicitly calling that constructer/conversion - in short.
Im interested in if it is possible to make a single argument explicit somehow (short of roling a new type) ? perhaps using compiler extensions ?
Using a reference makes copy-construction impossible, so that is a solution, albeit not the one im looking for. It would be neat tool/interface specifier sometimes to be able to force explicit
at a function level.
void f(std::string& s); //cannot copy convert into s
void f(const std::string& t);//calling with char* allowed
Specificly for strings, what type should be used to avoid construction from char*
?