no matching function

Hello,

I get this error,

error: no matching function for call to ‘A::a(std::string&)’
note: candidates are: static D* A::a(std::istream&)

I am calling this function like this

D *d = A::a(filename);

Note that the function signature is like this

static D *a(istream &s);

What is wrong and who to call this function

Regards
It might be easier if you paste more of the code.

But I am guessing that you are trying to pass a string to a
function that wants a std::istream.

If that is the case then you may want something more like this:

1
2
3
std::ifstream file(filename);

D *d = A::a(file);

You are right. the mismatch came from string and istream classes.


Thanks

Topic archived. No new replies allowed.