Category : c++20

TLDR: std::chrono::sys_time<std::chrono::microseconds> tTimePoint; std::istringstream stream("2020-09-16 22:00:00.123456"); std::chrono::from_stream(stream, "%Y-%m-%d %H:%M:%S", tTimePoint); I expected the code above to parse the .123456 as microseconds. However, when running this tTimePoint only contains the date and time excluding subseconds. Longer: I am using Visual Studio 2019 with the cpplatest flag on Windows 10. I have a simple input where users ..

Read more

I’m trying to implement a thread-safe mcmp-queue, I’m doing this with a resizable circular buffer, but I’m running into bugs. Currently I’m just testing the following class by writing to the queue on one thread, and reading it on another; but I get unexpected outputs. I suspect my resizing is bugged, but I’m currently scratching ..

Read more

According to cppreference.com ( https://en.cppreference.com/w/cpp/compiler_support#C.2B.2B20_features ) Clang has partial support of C++20 coroutines since version 8: But if in Clang trunk (which is upcoming version 13) I write #include <coroutine> it results in the error( https://gcc.godbolt.org/z/rTfjbarKz ): /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/coroutine:334:2: error: "the coroutine header requires -fcoroutines" #error "the coroutine header requires -fcoroutines" And if I add -fcoroutines ..

Read more