Spoiled Milk
Banned
Double post. I owe it to you all to explain what my frustration in C++ was. It started with this line:
I wanted to put this in its own function. But I didn't want to keep auto. I think it was giving me my hundreds of template instantiation errors but you can never be sure. (Will concepts fix this? Who knows.) That and I needed to do things with the return type.
Tried jumping to ::now()'s definition. "No definition found". Oh no... So then I tried jumping to high_resolution_clock's. "No definition found". Oh shit. Ctrl-f'd in chrono's header file (which is not suffixed by an h. Nice!). Found this gem.
Thanks bjarne :^) This is also why this part of the library has its own cast for time-deltas "duration_cast".
Don't worry, though. If you have issues with C++, you can always use C and C avoids these issues. C avoids these issues by being useless for complex tasks. Hurray!
Code:
auto startTime = std::chrono::high_resolution_clock::now();
Tried jumping to ::now()'s definition. "No definition found". Oh no... So then I tried jumping to high_resolution_clock's. "No definition found". Oh shit. Ctrl-f'd in chrono's header file (which is not suffixed by an h. Nice!). Found this gem.
Code:
// To support the (forward) evolution of the library's defined
// clocks, wrap inside inline namespace so that the current
// defintions of system_clock, steady_clock, and
// high_resolution_clock types are uniquely mangled. This way, new
// code can use the latests clocks, while the library can contain
// compatibility definitions for previous versions. At some
// point, when these clocks settle down, the inlined namespaces
// can be removed. XXX GLIBCXX_ABI Deprecated
Don't worry, though. If you have issues with C++, you can always use C and C avoids these issues. C avoids these issues by being useless for complex tasks. Hurray!