I have this class:
class FileRatio{
public:
double x;
double y;
FileRatio(double xx,double yy){
this->x = xx;
this->y = yy;
}
};
When I choose "build", XCode is able to build it. When I choose "run", then I get a "build failed" message:
No matching constructor for initialisation of FileRatio
What is the problem ?
EDIT: I try to use it in the following ways:
std::unordered_map<std::string, FileRatio>fileRatioMap;
std::vector<std::string> tokens = split(line, ',');
FileRatio fileRatio = FileRatio(stod(tokens[1]),stod(tokens[2]));
fileRatioMap[tokens[0]] = fileRatio;
And later I do:
FileRatio ratio = fileRatioMap[name];
EDIT: The compiler does not highlight a specific line in MY code. Instead, it appears in some class called "memory" which is part of Xcode's toolchain.
EDIT:
The whole error message is:
No matching constructor for initialisation of FileRatio
The line that is highlighted is:
construct(_Up* __p, _Args&&... __args)
{
::new((void*)__p) _Up(_VSTD::forward<_Args>(__args)...);
}