overload c++ duty according relapse value


we know profusion duty according parameters:



int mul(int i, int j) { relapse i*j; }
std::string mul(char c, int n) { relapse std::string(n, c); }


can profusion duty according relapse value? interpretation duty advantage opposite things according relapse value used:



int n = mul(6, 3); // n = 18
std::string s = mul(6, 3); // s = "666"
// note both invocations take accurate same parameters (same types)


you assume initial parameter between 0-9, need establish quarrel have any blunder handling.



Comments

Popular posts from this blog

list macos calm editors formula editors

how hibernate @any-related annotations?

why does floated <input> control floated component slip over too distant right ie7, nonetheless firefox?