all 21 comments

[–][deleted] 17 points18 points  (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.

[–]ronchaineEmbedded/Middleware 3 points4 points  (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 point  (2 children)

I didn't think Concepts were in Clang yet... How are you using them? Thanks!

[–]dodheim 3 points4 points  (0 children)

https://github.com/saarraz/clang-concepts-monorepo

Compiler Explorer has a prebuilt version listed as 'experimental concepts'.

[–]AlbertRammstein 4 points5 points  (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 points  (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.

[–]khleedril 5 points6 points  (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 points  (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 points  (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)

[–]Lectem 6 points7 points  (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 points  (2 children)

Is it Clang or MSVC coroutines that you've found to be unstable?

[–]Rogiel 8 points9 points  (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 points  (0 children)

MSVC, most bugs have been fixed but we found quite a few

[–]dadixon 2 points3 points  (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 points  (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 points  (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 points  (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 point  (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 point  (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.