Forum Replies Created
-
AuthorPosts
-
::
std::boolalpha is sticky. It’s sufficient to use it only once: https://godbolt.org/z/snqGTvbWs
::You don’t know. It depends on the accuracy of your system clock. The system clock represents the system-wide real time wall clock on your system. Typically, the epoch of the system_clock is the Unix Time (1 January 1970). Since C++20 it must be Unix Time.
When you display the time since epoch, define your tick (seconds, minutes, hours, …) and use it.
Here is the resolution in hours:
const auto p1 = std::chrono::system_clock::now();
std::chrono::duration_cast<std::chrono::hours>(p1.time_since_epoch()).count()This post https://www.modernescpp.com/index.php/the-three-clocks provides you more details. Study in particular the example now.cpp.
::First, the once more disappeared. The trick was to create and delete a replay immediately.
Here is my proof:
0I often see Facebooks ‘Folly’ recommended https://github.com/facebook/folly , boost libraries, and llvm clang, but they’re quite heavy weight.
Here is a repo with a bunch of Open Source C++ projects supposedly in modern C++, but I haven’t looked through it much. https://github.com/rigtorp/awesome-modern-cpp
Here is a similar discussion with a bunch of suggestions https://news.ycombinator.com/item?id=24901244
If you look through large popular libraries you’ll tons of boilerplate code and lots of template metaprogramming. It might be easier to read some higher level code of smaller applications?
Tomorrow, I think about an alternative forum tool.
::Now, your comments suddenly appeared. I have no idea, why? Here is what I changed:
- I enabled nested replies.
- I changed your displayed name to Jonny.
- I played in the topic that didn’t displayed your replies with the reply button and the reply editor. I assume that flushed the cache.
Honestly, I have no idea what is going on. Also google gave me no hint. I will observe this weird behavior. At least, your comments are not lost.
::Here is the short answer. Late binding (virtuality) is typically implemented with a pointer indirection. You have to pay for this pointer, but sometimes you don’t need it. Therefore, you use in C++ by default, in contrast to Java or Python, early binding.
Long answer: Wait for our inheritance lessons. -
AuthorPosts