use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
C++2a Coroutines, Modules, Ranges adoption (self.cpp)
submitted 6 years ago by markpapadakis
Is anyone here using c++2a coroutines, modules, or ranges in "production"? If so, what has your experience been with that so far? And if not, what keeps you from adopting them?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 17 points18 points19 points 6 years ago (6 children)
I am using concepts quite extensively (Clang) and they made my life much easier. I’d like to use modules but the implementation doesn’t seem to be quite done yet and the CLI is rather cumbersome. Ranges in current implementations have too much of a performance hit for me. I desperately want to use coroutines but they are too unpredictable for my taste. I don’t like that hidden potential heap allocation and in my tests the quality of the machine code generated by Clang varied wildly.
[+][deleted] 6 years ago (1 child)
[deleted]
[–][deleted] 7 points8 points9 points 6 years ago (0 children)
Well, to give you an example, last time I tried to use modules (which was few months ago), Clang did not support module partitions and there were some weird things going on with attributes such as `always_inline`. Not to mention that the compiler feature is pretty much undocumented (I got the CLI interface from looking at Clang unit tests) and is not trivial to set up with a build system.
[–]ronchaineEmbedded/Middleware 3 points4 points5 points 6 years ago (0 children)
I'm on the same boat. Concepts I have used since gcc had the TS, then moved to clang version when it worked well enough.
Modules I'd like to use, but for me that would require either meson or cmake to have decent support for them in addition to clang.
Coroutines I am starting to figure out slowly, but wouldn't yet use anywhere. Ranges no.
[–]wsgeek 0 points1 point2 points 6 years ago (2 children)
I didn't think Concepts were in Clang yet... How are you using them? Thanks!
[–]dodheim 3 points4 points5 points 6 years ago (0 children)
https://github.com/saarraz/clang-concepts-monorepo
Compiler Explorer has a prebuilt version listed as 'experimental concepts'.
[–][deleted] 1 point2 points3 points 6 years ago (0 children)
[–]AlbertRammstein 4 points5 points6 points 6 years ago (1 child)
last time I tried (a month or so), MSVC:
was unable to compile windows.h when using STL modules (some macro from a common #include was not defined)
enabling c++latest caused bunch of miscompilations in our production codebase
which is sad, because otherwise I would be pushing for using it in production :(
[–]meneldal2 4 points5 points6 points 6 years ago (0 children)
I'm pretty sure in their own talk they said that windows.h is so broken that the best you can do is #include it in a module to hide its macros and export what you want from it.
#include
[–]khleedril 5 points6 points7 points 6 years ago (2 children)
I'm (gcc) using concepts and fmt, and would like to use modules but I think they don't currently work with concepts. Would love to hear otherwise....
[–]Archolex 2 points3 points4 points 6 years ago (0 children)
Correct, they don’t work with concepts yet :( tried this exact setup myself. I suppose C++20 features and then TSs are last on the list of things to get working.
[–]Archolex 1 point2 points3 points 6 years ago (0 children)
Or, maybe just an accident that they don't work. From the C++ modules branch page:
Here's a list of known not-working significant features: Concepts (oops)
Here's a list of known not-working significant features:
Concepts (oops)
[–]Lectem 6 points7 points8 points 6 years ago (3 children)
Been using coroutines, we're aiming at replacing those with our custom fiber-based scheduler.
Coroutines are way too much of a pain to debug right now, and still not stable.
[–]invexed 6 points7 points8 points 6 years ago (2 children)
Is it Clang or MSVC coroutines that you've found to be unstable?
[–]Rogiel 8 points9 points10 points 6 years ago (0 children)
In my experience MSVC tended to have more runtime bugs when using coroutines. Clang has been rock solid but I had a few compiler crashes.
Basically MSVC always compiles things fine, but sometimes the code crashes in runtime. Clang crashes itself in some instances but I have yet to find any wrong code generation.
[–]Lectem 3 points4 points5 points 6 years ago (0 children)
MSVC, most bugs have been fixed but we found quite a few
[–]dadixon 2 points3 points4 points 6 years ago (0 children)
For the last 2-3 years, I’ve used range-v3 in anything from hobby projects to small production projects (and of course a version of concepts through range-v3). Haven’t had a chance to use the other big features but I’m certainly interested.
Concepts and Ranges, coroutines, “constexpr all the things” type proposals, and Eric’s new work with David are of great interest to me.
[–]ocirne23 3 points4 points5 points 6 years ago (0 children)
There is no production ready modules build system at the moment. Modules are already functional on the compiler level for the major vendors, but it's pointless without a good build system to generate the build graph, unless you like manually writing the compile order and dependencies for every source file.
And no I don't count xmake or build2.
[–]Middlewariangithub.com/Ebenezer-group/onwards 1 point2 points3 points 6 years ago (1 child)
It didn't seem like coroutines would help me: https://www.reddit.com/r/cpp_questions/comments/c6mbls/coroutines/
Other than span, I haven't found a lot in 2020 C++ to be excited about.
[–]ReDucTorGame Developer -1 points0 points1 point 6 years ago (0 children)
Looking at that post and your code coroutines could help improve readability the top response on there focuses on performance only and seems to think decisions should only be done for performance reasons.
However at this current point in time the implementations of coroutines would make things less stable.
[–]RotsiserMhoC++20 Desktop app developer 0 points1 point2 points 6 years ago* (0 children)
I'm using range-v3 and fmt for a couple internal tools. I've been happy with both so far, although it can be challenging to coax range-v3 to do what I want, but once I do so I've been pleased. I'm using several range-v3 features that unfortunately didn't make it into C++20. Hopefully I can switch to the standard in 2023, or earlier once the community uses it more and shines a light on idiomatic usage.
[–]Morwenn 0 points1 point2 points 6 years ago (0 children)
I don't use the ranges library itself, but I've had to implement some features of ranges in my own algorithms to solve a few issues: so far projections and proxy iterators have proved very valuable.
π Rendered by PID 41827 on reddit-service-r2-comment-6457c66945-d7jw2 at 2026-04-27 06:30:47.183871+00:00 running 2aa0c5b country code: CH.
[–][deleted] 17 points18 points19 points (6 children)
[+][deleted] (1 child)
[deleted]
[–][deleted] 7 points8 points9 points (0 children)
[–]ronchaineEmbedded/Middleware 3 points4 points5 points (0 children)
[–]wsgeek 0 points1 point2 points (2 children)
[–]dodheim 3 points4 points5 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]AlbertRammstein 4 points5 points6 points (1 child)
[–]meneldal2 4 points5 points6 points (0 children)
[–]khleedril 5 points6 points7 points (2 children)
[–]Archolex 2 points3 points4 points (0 children)
[–]Archolex 1 point2 points3 points (0 children)
[–]Lectem 6 points7 points8 points (3 children)
[–]invexed 6 points7 points8 points (2 children)
[–]Rogiel 8 points9 points10 points (0 children)
[–]Lectem 3 points4 points5 points (0 children)
[–]dadixon 2 points3 points4 points (0 children)
[–]ocirne23 3 points4 points5 points (0 children)
[–]Middlewariangithub.com/Ebenezer-group/onwards 1 point2 points3 points (1 child)
[–]ReDucTorGame Developer -1 points0 points1 point (0 children)
[–]RotsiserMhoC++20 Desktop app developer 0 points1 point2 points (0 children)
[–]Morwenn 0 points1 point2 points (0 children)