In my project, before I upgraded to VS2015, it compiled just fine. Now I'm getting 10 errors that have to do with std::chrono::timepoint. These are all the errors: https://gyazo.com/0d3c51cf87c49661b0f24da4a027b0d9 (image since there's so many)
Example lines of code that cause errors:
fStart = clock::now(); causes no operator '=' matches these operands
double t = std::chrono::duration_cast<std::chrono::milliseconds>(clock::now() - fStart).count();
causes
no instance of function template 'std::chrono::duraction_cast' matches the argument list. argument types are: ( <error-type> )
(fStart is a chrono::system_clock::timepoint, t is a double obviously)
Here is the full function those errors are from if someone wants to see it:
void Animation::update() {
using clock = std::chrono::high_resolution_clock;
if (animType == TYPE_MS) {
if (firstUpdate) {
fStart = clock::now();
firstUpdate = false;
}
double t = std::chrono::duration_cast<std::chrono::milliseconds>(clock::now() - fStart).count();
if (!paused) {
if (t >= frames[frame]->getTime())
advance();
}
} else if (animType == TYPE_FRAME) {
if (firstUpdate)
firstUpdate = false;
if (!paused)
fTime += speed;
if (speed < 0.0) {
if (fTime <= -frames[frame]->getTime())
advance();
} else {
if (fTime >= frames[frame]->getTime())
advance();
}
}
}
What am I supposed to do to fix these?
fStartis? :) - melak47std::chrono::time_pointis a template. time_points from different clocks are not necessarily convertible. We need to know the actual type. - melak47high_resolution_clock::time_pointin asystem_clock::time_point- melak47[std::chrono::high_resolution_clock] may be an alias of std::chrono::system_clock or std::chrono::steady_clock, or a third, independent clock.here - melak47