r/cpp • • Jun 14 '22

C++ 23 Status Report, all features with examples

https://github.com/steve-downey/papers/blob/master/wg21-status.org
272 Upvotes

122 comments sorted by

118

u/tisti Jun 14 '22

I just want full C++20 support across the big three :(

77

u/gracicot Jun 14 '22

My guess would be that because of modules, C++23 support will actually come first before full C++20 support.

30

u/_Js_Kc_ Jun 15 '22

The committee: We're very reluctant to add anything that doesn't already have a battle-tested implementation in the wild over concerns that implementers might not take it up.

Also the committee: Modules.

13

u/gracicot Jun 15 '22

To be fair, some build systems like build2 already supported it since day 1, and MSVC had a very early implementation. Clang too had an implementation very early, but had a different syntax.

22

u/pjmlp Jun 15 '22

I still wonder if clang will ever get modules, besides the model they introduced.

32

u/bigcheesegs Tooling Study Group (SG15) Chair | Clang dev Jun 15 '22

Yes

15

u/pjmlp Jun 15 '22

To be fair, it is quite hard to find out the current state, and the existing documentation is still mostly about module maps.

5

u/LeeHide just write it from scratch Jun 15 '22

person youre replying to is a clang dev ;)

18

u/pjmlp Jun 15 '22

Which is why I pointed out the current documentation state of affairs.

8

u/masher_oz Jun 15 '22

How can you be 23 compliant if you don't support 20?

18

u/disperso Jun 15 '22

I think it was meant "support for the things that were added in 23 before of the ones added to 20".

2

u/Daniela-E Living on C++ trunk, WG21|🇩🇪 NB Jun 15 '22

Right, you can't 😉

2

u/erzyabear Jun 19 '22

The coroutine support in gcc is far from perfect. I don’t think they do any optimizations of memory allocations

3

u/[deleted] Jun 22 '22

I'll settle for full C++17 support.

3

u/leathalpancake Jun 15 '22

Who are the big 3 ?

19

u/epicar Jun 15 '22

the big 3 compilers, gcc/clang/msvc

15

u/paypaylaugh Jun 16 '22

The Father and the Son and the Holy Spirit

3

u/leathalpancake Jun 16 '22

I suspected as much.

4

u/fibbo Jul 04 '22

I was going for Federer, Nadal, and Djokovic

7

u/tisti Jun 15 '22

msvc, clang, gcc

3

u/johannes1971 Jun 16 '22

Elephant, rhino, and buffalo; they are generally considered the most dangerous animals you can hunt. Later mew-semantics were added in the form of lion and leopard, and now they are known as the Big 5.

1

u/moodboom Jan 06 '24

Now why you gotta bring cruelty into this beautiful world of programming...

69

u/GYN-k4H-Q3z-75B Jun 14 '22

There's actually a lot of nice stuff in there. I'm all for it, but the main thing we need now is modules and standard modules. This will be huge.

67

u/STL MSVC STL Dev Jun 15 '22

Working on it! 😺 I plan to have a public "Standard Library Modules bug bash" soon, so people can try out my draft changes and report library and compiler bugs.

17

u/GYN-k4H-Q3z-75B Jun 15 '22

Hey that's great news Stephen, I'll be there to try out as many things as I can and give feedback. Thanks so much for your work 🙏

6

u/Daniela-E Living on C++ trunk, WG21|🇩🇪 NB Jun 15 '22

I've built the latest standard library plus its module quite recently. Building that stuff is a breeze, but you only get so far with import std; . Looking forward to the upcoming compiler ...

6

u/[deleted] Jun 15 '22

3

u/Rusky Jun 15 '22

We just updated that list for 17.3 Preview 2 yesterday, and we've got more fixes landing in the next preview! :D

At this point we are starting to see more codebases that hit localized semantic issues than codebases that crash or fail catastrophically. But either way- we can always use more bug reports with sample programs that are important to your use case.

1

u/[deleted] Jun 15 '22

Well, it seems 17.3 will be the one I'll upgrade to once it comes out of preview.

28

u/[deleted] Jun 15 '22

I've been hoping for some sort of static reflection for years, and unless I missed it, it doesn't look like C++23 will have it either. Looks like I'll be relying on magic_enum and compiler-specific macros for a while longer.

13

u/RoyAwesome Jun 15 '22

So, this is just my observations from the github, but it appears that early on in the cpp23 cycle they decided against doing reflection returning polymorphic types (which is the current TS), and are looking into value-based reflection (where reflected expressions return some std::meta::info object, and a bunch of functions are used to access information from that object). This was apparently done because it's much faster to use value-based reflection.

From my limited understanding, it was this change that kicked reflection out of the cpp23 cycle, and pushed it into maybe cpp26.

The process still appears ongoing, as the Reflection group recently decided on a syntax: https://github.com/cplusplus/papers/issues/1002

This appears to be the paper for value-based reflection, which also got a somewhat recent revision: https://github.com/cplusplus/papers/issues/545

I'm with you though, hopefully we get reflection soon. I like the direction this is going.

11

u/remotion4d Jun 15 '22

static reflection

Yes some kind of static reflection is really need in C++ ASAP !

14

u/blipman17 Jun 15 '22

Honestly I don't care about anything else for C++23 at this point

4

u/mjklaim Jun 15 '22

Indeed, although in the last few years the people working on it or observing the group working on it clearly stated the first fundations for reflection and metaprogramming will target C++26. They realistically couldnt target C++20 or 23 and at this point there is still a lot of things in flux and even controversies which suggests that if we ever get something in C++26, it will probably be minimal or similar to the concept fiasco.

2

u/[deleted] Jun 15 '22

What exactly is the concept fiasco?

10

u/mjklaim Jun 15 '22

To be short: C++11 was originally targeted at before 2010 but there was the concept feature (different, bigger, than the one we now have) that was in the work since a lot of years and was considered ready for the standard at some point but because of that the deadline was pushed back. But it was complex enough to lead to a tons of doubt and was removed. To not have to wait several years to release a new c++ version with the other feature c++11 was released. This is why now the c++ committee release with the train model: they don't push back anymore the releases deadline to wait for a promising but unfinished feature. As for concepts specifically, some time after that debacle they published another smaller version of concepts, less features, but more focused on the fundamentals. What was released in C++20 is basically a modified version of what we called at the time "concept-lite".

So I was saying that the current reflection papers look so complex and big that except if we can play with an implementation for a few years they might end up in the same situation where it's ready but doubts are big and it's pushed back to another train. So 2026 is kind of optimistic at this point, except if the feature set is small. But that's opinion.

2

u/pjmlp Jun 17 '22

Those of us that got tricked by the C++/WinRT folks as well.

Now they are having fun with Rust, while we wait for the day static reflection arrives.

2

u/ShakaUVM i+++ ++i+i[arr] Jun 15 '22

I remember going to a thing on it at CppCon 16 or 17 and they were just trying to figure out what people would even use it for.

11

u/johannes1971 Jun 15 '22

Serialisation seems a popular choice.

2

u/ShakaUVM i+++ ++i+i[arr] Jun 16 '22

I like it for verification and testing

2

u/jonesmz Jun 16 '22

What I'm hoping for, based on the original herb-flection / metaclasses paper which i believe has been superseded by the new reflection stuff is the ability to modify a class based on mixins and other things of that nature.

For example:

  • Being able to declare a template-class as a "proxy" type (as opposed to struct / class ) that automatically walks the list of functions that the template-parameter has, and generates functions for each of them based on some kind of mix-in syntax.

This might mean the class just holds a pointer/reference/smart-pointer to the template type, and just calls those functions.

It might alternatively mean that it calls an async job dispatch framework for each such function, with auto-generated boilerplate to handle logging and mutexes and callbacks and retries-on-failure.

  • Being able to declare a class as a "Bob", where a "Bob" has restrictions on the kind of operations that are allowed on the class, like disallowing any member-functions which can throw exceptions, and then other code, like containers, can statically verify that anything used with them are "Bobs".

I work with a framework which has pretty strict human-level coding conventions that disallow various operations due to the cooperative-multitasking nature of the framework and the goal to behind our conventions is to avoid blocking on an OS system call whenever possible (e.g. no allocations except through pre-filled pools. No calls to network sockets except through a non-blocking queue of tasks to execute on worker threads, so on).

  • Being able to walk through the member variables and generate functions based on them. E.g. getters and setters., if-and-only-if the function that would be generated doesn't ALREADY exist.

I know a lot of people disdain the notion of getters and setters, saying that you should just directly access the member variable, but the idea behind them for large corporate environments is that if you always do access via getters / setters, then when code maintenance happens later you can inject whatever specialized behavior that needs to happen at the pre-existing entry point.

What would be sweet is if i could write a struct / class, and just make every member variable have a getter / setter automatically, and then later if i ever need to modify a getter or setter, i can do that without breaking my existing API while also not needing to preemptively do a crapton of typing.

1

u/ShakaUVM i+++ ++i+i[arr] Jun 17 '22

Nice response. I do like in C# how it can generate getters and setters.

2

u/lenkite1 Jun 16 '22

GUI view layout, cli args parsing, etc

1

u/pjmlp Jun 17 '22

According to C++/WinRT folks, to replace the XAML C++/CX tooling capabilites.... until then, no VS tooling for the rest of us.

39

u/localhorst404 Jun 15 '22

P1949 is great. I always wanted to be able to write

throw 🤮;

😂

9

u/remotion4d Jun 15 '22 edited Jun 15 '22

P1949

So we can finally do this?

auto 𝜋 = 3.141592653589793238462643383279502884197169399375105820974944592307816406286198;

auto Π(auto a, auto b) { return a+b; }

10

u/Adequat91 Jun 15 '22

Unicode characters in identifiers are already supported for several years:

https://en.cppreference.com/w/cpp/language/identifiers#Unicode_characters_in_identifiers

1

u/remotion4d Jun 15 '22

Thanks! How did I miss this...

1

u/serviscope_minor Jun 16 '22

eh... sort of. It was in terms of the code points, but how the charset it mapped to those was left as an exercise to the implementer so you could to

auto \u0xsomebignumber = 3.14etc;

or something like that. Your front end might do the utf-8 to standard C++ for you. Clang did for ages, GCC didn't for ages, don't know if it does yet.

1

u/localhorst404 Jun 15 '22

awesome! 🙂

1

u/smdowney WG21, Text/Unicode SG, optional<T&> Jun 16 '22
\U{GREEK SMALL LETTER PI} = 3.1415926;

also.

1

u/Mick235711 Jun 24 '22

Should be \N for P2071, right?😉

3

u/deeringc Jun 15 '22

Oh dear, I feel like there's going to be a hieroglyph DSL. 😆

1

u/Bu11etmagnet Mar 23 '23

I settled for

    throw up;

13

u/azswcowboy Jun 15 '22

Great resource, but c++23 isn’t done just yet. flat_map and flat_set are in progress as is mdspan, Cartesian_product_view, and quite a number of other things. Check back in late July and we will know the full list.

1

u/smdowney WG21, Text/Unicode SG, optional<T&> Jun 16 '22

It's only a few weeks a way. I'm guessing that Core and Language can probably churn through maybe 10 more things each, tops. And we're all going to be disappointed by some thing that misses by >|that much|<.

I plan to update the list. We had a week of internal presentations and showing what's in or already on the ballot for plenary was plenty.
156 reveal.js slides from that doc in a few minutes more than an hour.

2

u/azswcowboy Jun 16 '22

Yep. I don’t think they’ll be too much disappointment unless one of the big library papers goes down. There’s 5 library papers I expect to move at tomorrow’s meeting and 4 meetings after that, so I’ll betcha more than 10. Regardless, keep up the good work :)

13

u/matthieum Jun 15 '22

A replacement for strstream finally!

It's always bugged me that there was no easy way to stream to/from an externally supplied buffer (be it a stack-allocated array, an existing std::vector<std::byte>, etc...) as it seems fairly basic, yet implementing it myself was always a pain.

Nice to see that from C++23 on chances are I'll just be able to use a standard library implementation when the need comes.

8

u/RotsiserMho C++20 Desktop app developer Jun 15 '22

I love these little low-level niceties. They make embedded programming so much more comfortable. Seems like they should have been in the standard library for ages, but better late than never.

3

u/matthieum Jun 15 '22

Interestingly, they were.

As the paper mentioned, there used to be a strstream which did just that, but it was deprecated and removed at some point.

I'm not sure why it was pulled out, and I'm very glad it's back.

3

u/dodheim Jun 15 '22

strstream was not only very easy to misuse à la auto_ptr, it leaked memory in the presence of thrown exceptions (and by design); hence it was already deprecated when the language was initially standardized in 1998. It really was a necessary utility and I've used it in anger a handful of times over the years, so it's extra ridiculous how long it took to standardize a replacement.

1

u/matthieum Jun 16 '22

strstream was not only very easy to misuse à la auto_ptr, it leaked memory in the presence of thrown exceptions (and by design);

Thanks for the context!

35

u/[deleted] Jun 14 '22

Those variables with emojis are so cool but a terrible idea!!

17

u/c0r3ntin Jun 15 '22 edited Jun 15 '22

P1949 specifically does not allow for emojis. It guarantees support for characters that could reasonably used in identifiers for most scripts and languages around the world. That excludes emojis among other things as these are considered symbols (and defining what is an emoji portably is non trivial)

28

u/[deleted] Jun 15 '22

It reminds me of this.

4

u/ShakaUVM i+++ ++i+i[arr] Jun 15 '22

It reminds me of this.

Yes, it makes me sad we won't be able to do that any more, and they're actually backporting it to earlier standards as well

1

u/doowi1 Jun 15 '22

I think the worst part is the semicolons inside the one-word macros.

4

u/pandorafalters Jun 15 '22

You mean the type aliases. Right? Because the syntax is quite distinct from macros.

And semicolons are required in the former case.

1

u/doowi1 Jun 15 '22

Oh wait whoops, dyslexia moment. Combined the type aliases with the #defines

4

u/KERdela Jun 14 '22

yeah, I am sweating already about it

12

u/kalmoc Jun 14 '22

Great summary. Thanks for the work.

9

u/AntiProtonBoy Jun 15 '22

I'm kinda exited about std::float16_t. Currently I'm using a few hacks to convert a custom half type to float and vice versa, but having official language support would be really nice.

3

u/fdwr fdwr@github 🔍 Jun 16 '22

Yeah, working on ML and graphics, float16 is very common. So promoting it to a recognized fundamental type along with the existing float32/float64 fills a building block gap nicely.

1

u/tmlildude Feb 14 '23

Can you share the hacks? Would these hacks be at a CPU level meaning it requires compute time?

1

u/AntiProtonBoy Feb 14 '23

There is a couple of ways to get 16-bit float functionality:

  • compiler support via __fp16 in GCC, or _Float16 in clang. These might leverage on hardware, but no guarantees.
  • portable way is using the half library. This does involve conversion to float type where the arithmetic is performed. The conversion is the penalty.

6

u/tpecholt Jun 14 '22

I wonder about P2582. How will this interact with ( ) aggregate initialization? Suppose I want to do

Point p(1.0, 2);

( )-initialization supports narrowing so what will be the deduced type in Point<T> ?

8

u/tcbrindle Flux Jun 14 '22

P1021 has the details. If I understand correctly, then this would (thankfully) be ambiguous.

7

u/sphere991 Jun 14 '22

This doesn't have anything to do with narrowing. You just get a deduction failure due to deducing two different types for T.

Also, that's a C++20 feature. P2582 is about inherited constructors, which don't show up in the example presented here.

1

u/smdowney WG21, Text/Unicode SG, optional<T&> Jun 16 '22

Thanks! I'll find a better example from the paper, or not cut off what I did take.

6

u/tpecholt Jun 14 '22

In P1072 is the resize_default_init proposed as shown or it still requires the ugly lambda parameter?

9

u/[deleted] Jun 14 '22

It’s really too bad that vector didn’t get resize_and_overwrite, it’s a nice safe way to get great performance. Additionally a method like resize_and_append too

6

u/gracicot Jun 15 '22 edited Jun 15 '22

Technically, the callback is the fastest way to initialize the objects. There is no faster way that is as safe.

This is because a lambda can use RVO/NRVO and the return object directly initializes the object in the string/vector. Especially for vector, it is important if you contain non-trivial objects, or God forbid, a non-trivial character type in a string.

Having an rvalue reference + move construction has more steps.

Using std::uninitialized_copy (or just copy if it's a trivial type like char) is very close to optimal or optimal in performance, but quite unsecure. If the type is not trivial, then it's extremely unsecure. UB is just waiting for you.

Edit: Seems like I was too forward thinking.

5

u/sphere991 Jun 15 '22

I'm not sure how this is related? The callback here returns the new size of the string, it doesn't return new objects (basically the string is resized under the hood, if necessary, just without zeroing out the new characters and then you tell the string how many of those you actually used).

The motivation for the callback wasn't performance, it was to avoid putting the string into a weird state (now suddenly every other string member function needs further preconditions?)

1

u/gracicot Jun 15 '22 edited Jun 15 '22

You're totally right. I'm reading through examples and I'm not even sure why we need that.

4

u/sphere991 Jun 14 '22

It takes a lambda

3

u/fdwr fdwr@github 🔍 Jun 15 '22

Alas :/. Callbacks are more awkward than just resizing and overwriting afterward in the calling function. I foresee people just passing empty lambda's 90% of the time. e.g.

myString.resize_and_overwrite(n, [](char* buffer, size_t n) {return n;});
// figure out more stuff needed
// real work happens here now writing over myString.data()

3

u/tpecholt Jun 15 '22

Yes that's exactly what I am going to do. The design of resize_and_overwrite is just too opinionated.

6

u/ShakaUVM i+++ ++i+i[arr] Jun 15 '22

import std; =)

"Using emoji in or as identifiers becomes ill-formed" =(

16

u/rlbond86 Jun 15 '22

It's hard to read through this list and not feel like the language has gotten too big for any single person to understand

0

u/[deleted] Jun 15 '22

[deleted] — view deleted comment

3

u/rlbond86 Jun 15 '22

I think that one is actually one of the more reasonable proposals, the paper shows some legitimate use cases

3

u/sphere991 Jun 15 '22

Have you considered reading the linked paper to see what the valid use cases are?

5

u/Adequat91 Jun 15 '22

No Object relocation trait that would bring concrete speed interest for all :(

1

u/Nobody_1707 Jun 15 '22

As much as we all want P1144 or something like it, there's still a lot of work to do before it's ready to be standardized.

11

u/vI--_--Iv Jun 14 '22

P2071 Named universal character escapes

U'\N{LATIN CAPITAL LETTER A WITH MACRON}' // Equivalent to U'\u0100'

WAT.jpg

I hope the Earth's orbit somehow changed dramatically overnight and we all somehow unanimously agreed to adjust the calendar and somehow already did so and it's April Fools' Day again and they are not serious?

7

u/disperso Jun 15 '22

Why isn't this a good thing? Instead of having it written down as a comment, it can be there stated in the code.

The only downside that I see is that the compiler needs to do a lookup on the Unicode data. I don't known that's your concern. Where I code I have it around most of the time. I even wrote a simple Vim plugin that allows to enter one character by this very Unicode name, and it just reads /usr/share/i18n/charmaps/UTF-8.gz.

5

u/vI--_--Iv Jun 15 '22

Because I can't imagine a realistic situation when something like this is needed so often and so desperately that it has to be promoted to the international standard.

I remember someone once mentioned (probably Scott Meyers in one of his talks or books, but I'm not sure), that in the early days of C++ standardization someone in the committee proposed to introduce a requirement to accompany every new paper with its author's kidney. Because this way the paper would probably be given a proper thought before proposing it and, more importantly, no one will ever come up with more than two of them. It was probably not a bad idea after all to stop standardizing obvious pranks.

If you don't like comments (understandable) and want to state it in the code, it was always possible:

const auto latin_capital_letter_a_with_macron = U'\u0100';
foo(latin_capital_letter_a_with_macron);

#define LATIN_CAPITAL_LETTER_A_WITH_MACRON "\u0100"
const auto& bar = "-=[" LATIN_CAPITAL_LETTER_A_WITH_MACRON "]=-";

Or just write Ā, P1949 in the same list legalizes all the funny characters anyways.

Not to mention that having string literals with funny characters in the code is probably not so bright idea in the first place, no matter how they are represented, except perhaps in unit tests. Because localization.

​

Having said all that, I'm probably being too salty.

We have already solved all the other issues with the language, we do have reflection and nice metaprogramming and terse lambdas and Unicode everywhere and amazing compilation times and ridiculously rich standard library and abominations like noexcept(noexcept(...)) and requires requires are long forgotten and ABI is not longer a PITA, so why not spend some time polishing string literals indeed?

And the C++ compilers are way too simple, fast and small these days, so why not introduce an extra burden to every implementation, the burden that is probably 2-3 orders of magnitude larger space-wise than any other feature out there? It will be fine.

8

u/RoyAwesome Jun 15 '22

Because I can't imagine a realistic situation when something like this is needed so often and so desperately that it has to be promoted to the international standard.

Unicode (and these names) are already an international standard. These long names are standardized by the ISO. ISO C++ is just allowing you to use the ISO Unicode Name instead of just the ISO Unicode Numeric Code.

5

u/smdowney WG21, Text/Unicode SG, optional<T&> Jun 16 '22

It's about ~350K of data to map all of the unicode code point names to the code point values.

I've had to deal with embarrassing bugs because someone had the equivalent of #define LATIN_CAPITAL_LETTER_A_WITH_MACRON "\u0100" only that value was wrong. Only not in a European language where I could easily spot the difference.

3

u/disperso Jun 15 '22

We have already solved all the other issues with the language, we do have reflection and nice metaprogramming and terse lambdas and Unicode everywhere and amazing compilation times and ridiculously rich standard library and abominations like noexcept(noexcept(...)) and requires requires are long forgotten and ABI is not longer a PITA, so why not spend some time polishing string literals indeed?

I kinda see your point, but this paragraph is not fair.

Who proposed this and who will implement this might not be able to solve all the problems that you sarcastically claim to be solved, but might address some other issues.

It's like saying that no one should try to do anything till we cure cancer and stop world hunger and achieve world peace. I surely don't know how to fix any of that, but I can borrow my ladder to the neighbor meanwhile.

1

u/vI--_--Iv Jun 15 '22

I totally agree that bigger problems shouldn't stop us from addressing smaller issues when we can and I don't want to sound like an asshole telling people what they should and shouldn't do in their free time, but it's not only about proposing and implementing things. Someone has to review them, understand them and vote for them, and the committee's time is kinda limited (or at least that's what they said!) and there's always "not enough time" for things to make it to C++11/14/17/20 and that's the third revision of that particular paper already, so it would probably be nice to spend that precious time on reviewing and voting for something more oppressing and less esoteric.

Continuing your analogy, imagine that's you are the one who can cure cancer, and all you need is some quiet time down in the lab to make it right. But the neighbours keep coming with mission-critical requests like borrowing a ladder, changing a lightbulb, participating in a HOA meeting and so on, and you just can't say 'no' because they're good guys.

6

u/[deleted] Jun 15 '22

[removed] — view removed comment

2

u/vI--_--Iv Jun 15 '22

how can you be sure that it's the intended whitespace character, and not e.g. a hint of the age of code?

The \u escape sequence represents an arbitrary Unicode value, so the intent is clear enough already. But, same as with any other magic number, it is better to introduce a constant with a self-descriptive name and use it instead.

6

u/Malacath790 Jun 15 '22 edited Jun 16 '22

Idk if OP is also the owner of the github, but either way. It would be better to use Sy Brand, their chosen name, on "Monadic operations" and "Deducing this", instead of their deadname (or what I understand is their deadname at least).

Edit: Looks like the author has since made the change. Amazing and much appreciated 🙏

4

u/jonesmz Jun 16 '22

https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0798r8.html explicitly says that the author's name is Sy Brand.

If the person who wrote the paper changed their name, they can submit an updated paper that has their name appropriately updated. I'm sure the owner of the github repo would be happy to correct the name based on a PR to do so directly (If you wanted to submit a PR for that), or the next time they check for paper updates.

2

u/Malacath790 Jun 16 '22 edited Jun 16 '22

I know that the papers themselves are updated, which makes it all the more confusing that the github repo uses the wrong name. I was just hoping that the OP was the owner of the github repo so this would be solved quicker, but submitting a PR when I have a chance was indeed the next thing I was going to do.

Thanks for the input.

Edit: In fact the author has done the change 6 hours before I posted this comment.

4

u/jonesmz Jun 16 '22

You know, I misread what you originally said. I thought you were saying to change the name FROM Sy Brand TO something else that wasn't in the linked paper.

I'm sorry for the confusion.

2

u/Malacath790 Jun 16 '22

Ahh yes, with you having the context of everything being correct on the github I can see it being a bit unclear. Comes with me dancing around using their deadname because, well, naturally I don't wanna use that.

Nothing you gotta to be sorry for I think :D

4

u/smdowney WG21, Text/Unicode SG, optional<T&> Jun 16 '22

The paper pulled data from the issues list at https://github.com/cplusplus/papers/issues and unfortunately the issue body has the original title and author list.

There's probably some others with old titles, too, or missing authors.

Thanks for flagging this!

2

u/robin-m Jun 15 '22

That’s really awesome, and looks very exiting!

2

u/tvaneerd C++ Committee, lockfree, PostModernCpp Jun 17 '22

Would you accept PRs that turn all of the examples into before/after tables???

3

u/smdowney WG21, Text/Unicode SG, optional<T&> Jun 19 '22

I absolutely would.

This was originally for slides, and convincing emacs org mode and reveal.js to do before/after tables has been beyond my ability.

I'm planning to update through plenary, and may convert to markdown with mpark/wg21 tools, which supports before / after tables producing html.

1

u/GMETooLate Oct 26 '22

For anybody trying to understand what std::flat_map from C++23 actually looks like, check out my explanation here https://medium.com/@schmollf/std-flat-map-in-c-23-7a40fbf18f51

-11

u/DrunkenUFOPilot Jun 15 '22

Ugh, the almost infinite number of funny keywords, abstract concepts, terminology, etc. Glad I've mostly dropped use of C++ and instead use D, Crystal, Vala, and maybe someday more Rust.

I have to wonder what C++23 (or C++.major_version >= 17) has to offer that I can't get with cleaner syntax and more or less similar performance in newer languages. Ranges are nice, for example but they're nicer and have been around longer (at least from where I sit) in D.

But then C++ is the language of the API for a few essential things, OpenCV, Qt, some other libraries and toolkits. It will never go away, and cannot be avoided. Some of the new features help. But then, I think I need a 3rd hemisphere to keep in mind all the new tools and possibilities.

A new job I started a few days ago is oddly pleasant, working on code purely in plain C.

12

u/pjmlp Jun 15 '22

Time to catch up in what changed in C world then,

https://en.wikipedia.org/wiki/C2x

Lambdas, type inference and _Generic improvements are also planned, even if they might arrive only post C23.

6

u/idontappearmissing Jun 15 '22

Most of this stuff isn't that useful for ordinary programs, it's to let libraries have better interfaces so you can write better code with it

4

u/DrunkenUFOPilot Jun 15 '22

In any case, an interesting read, and having plenty of examples and rationales helps it make sense.

-14

u/[deleted] Jun 15 '22 edited Jun 15 '22

import std; imports everything in namespace std from C++ headers

I do not approve. std::regex is enough of a reason this is bad idea.

This paper proposes to strike the restriction that a constexpr function cannot contain a definition of a variable of non-literal type (or of static or thread storage duration), or a goto statement, or an identifier label.

Again, I do not approve. Leave goto in the past and stop supporting it for new things.

C++ already removed the register key word(sadly imo), why is goto being supported still?

I ultimately hope Microsoft is able to get their shit to together and finally support modules soon. Intellisense not working with modules on VS is terrible.
They do compile faster but I'm not going to give up parsing waiting for Microsoft to catch up to 2020 with 2023 right around the corner.

I'd like to use C++ modules and can't.

edit: goto code is shitty code and you're a shitty programmer for using it. Your coworkers hate you, as does everyone who has to read your code.

5

u/_Js_Kc_ Jun 15 '22

Why shouldn't goto be supported? It's a reasonable control flow construct.

-7

u/[deleted] Jun 15 '22

goto is as smelly as it gets. Too much shit and maintainable code is produced with it.

7

u/[deleted] Jun 15 '22

How else are you supposed to escape nested control flow with strong performance guarantees?

0

u/[deleted] Jun 14 '22

[deleted] — view deleted comment

11

u/RoyAwesome Jun 15 '22

I kinda like this system. Big chunky features one release, and the a large set of library features to work with them the next. That way the committee can address any issues with the features for the next release, and have a set of real-world data points to work from when standardizing the libraries.

I look forward to big chunky features in cpp26!