Is there a name or a term for this type of conversion in the c++ community?
Has anyone seen this conversion be referred to as “implicit conversion”?
class ALPHA{};
class BETA{
public:
operator ALPHA(){return alpha;}
private:
ALPHA alpha;
};
void func(ALPHA alpha){}
int main(){
BETA beta;
func(beta);
return 0;
}
It’s normally called a conversion function. It isn’t an implicit conversion per se, but does allow implicit conversion to the target type.
Edit: just checked to be sure — §12.3.2 of the standard uses the phrase “conversion function”.
Edit2: I checked in the official standard, which isn’t (at least supposed to be) freely available (though you can buy it from the ISO or most member standards organizations such as ANSI, BSI, etc.) A lot of people prefer to save the money and use the final committee draft, which is free.