Forum Replies Created
-
AuthorPosts
-
17. May 2022 at 22:07 in reply to: autoExplicit.cpp in root folder is the same as in solutions folder #9924::
I mainly enabled “Marked Complete” because I don’t want to produce all videos before the mentoring.
Now, I’m almost done and I, therefore disabled, “Marked Complete”. But keep in mind, I’m almost done. There are still improvement I will make for the upcoming weeks.
I don’t know what you mean with “to review”. Please elaborate.
::I explain in detail lvalue reference and rvalue references when we talk about move semantics and perfect forwarding. This is week 6.
In this example I used various lvalues and rvalues and invoked a function template is_lvalue, overloaded for a lvalue reference and a rvalue reference: https://godbolt.org/z/hbWGznhsq
I discuss this in our next Q&A session.11. May 2022 at 08:42 in reply to: Scoped enum overflow: Different behaviour between MSVC and GCC (std=c++17) #9754::I could not find any wording about the behavior in the working draft of the C++ standard: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/n4910.pdf
I could also not find anything in the original proposal: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf
The MSVC only diagnoses a warning, but gcc, clang, and icc (Intel) an error: https://godbolt.org/z/z7qvEeGfb
The practice is that we get at least a warning.
::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.
-
AuthorPosts