Why error: ambiguating new declaration of 'std::string& strs(std::string&, const char*)'

Got this
error: ambiguating new declaration of 'std::string& strs(std::string&, const char*)'

though the declaration is bit different in types prototype,
ie. only in returned value type
1
2
3
4
5
6
7
8
inline string strs(string& s, const char* key){
	size_t f;
	return (f=s.find(key))==string::npos? "": s.substr(f);
}

inline string& strs(string& s, const char* key){
   // ...
}

How to solve it?
Last edited on
> ie. only in returned value type
the return type is not part of the signature
strs(s, "hello world"); ¿which version do you think it should be called?
Topic archived. No new replies allowed.