You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While I've found your presentations quite useful and clarifying, particularly about the use and intricacies of modules, I'd like to comment on two areas where I've discovered obstacles in moving towards C++20 and modules.
One is with std::chrono. My app uses Howard Hinant's date library for some fairly simple things, like getting the local, timezone-adjusted hour of the day, parsing a date entered as a command line argument (expected to be a very simple YYYY-MM-DD) and formatting a std::filesystem::last_write_time(). These things were done originally with functions from <ctime> but the date/chrono facilities made them cleaner and easier to maintain. I thought that migrating them to C++20 would be fairly straightforward. However, changing CMAKE_CXX_STANDARD to 20 proved otherwise. It seems that Hinnant's proposals were "tweaked" in the final standard and that clang++'s implementation isn't completed yet (at least for version 16).
The other area is testing. The major and "medium" players, i.e., GoogleTest, Catch2 and doctest all use macros and don't appear to be moving toward a non-macro solution anytime soon. There are three frameworks that advertise themselves as supporting C++20 and non-macro-based implementations, namely, Boost:UT, clean-test and snitch. I had had some success using UT with C++20 with g++ (12.2), so I was hoping it would work under clang++-16. However, trying to build it results in a segfault while running its own tests.
So it seems to me that C++20 modules, in spite of the progress made by CMake and the compilers, are still not quite ready for general use.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
While I've found your presentations quite useful and clarifying, particularly about the use and intricacies of modules, I'd like to comment on two areas where I've discovered obstacles in moving towards C++20 and modules.
One is with
std::chrono
. My app uses Howard Hinant's date library for some fairly simple things, like getting the local, timezone-adjusted hour of the day, parsing a date entered as a command line argument (expected to be a very simple YYYY-MM-DD) and formatting astd::filesystem::last_write_time()
. These things were done originally with functions from<ctime>
but thedate
/chrono
facilities made them cleaner and easier to maintain. I thought that migrating them to C++20 would be fairly straightforward. However, changingCMAKE_CXX_STANDARD
to20
proved otherwise. It seems that Hinnant's proposals were "tweaked" in the final standard and that clang++'s implementation isn't completed yet (at least for version 16).The other area is testing. The major and "medium" players, i.e., GoogleTest, Catch2 and doctest all use macros and don't appear to be moving toward a non-macro solution anytime soon. There are three frameworks that advertise themselves as supporting C++20 and non-macro-based implementations, namely, Boost:UT, clean-test and snitch. I had had some success using UT with C++20 with g++ (12.2), so I was hoping it would work under clang++-16. However, trying to build it results in a segfault while running its own tests.
So it seems to me that C++20 modules, in spite of the progress made by CMake and the compilers, are still not quite ready for general use.
Beta Was this translation helpful? Give feedback.
All reactions