C++23: An Overview of Almost All New and Updated Features - Marc Gregoire - CppCon 2023

  Рет қаралды 31,918

CppCon

CppCon

Күн бұрын

cppcon.org/
---
C++23: An Overview of Almost All New and Updated Features - Marc Gregoire - CppCon 2023
github.com/CppCon/CppCon2023
As I have done for previous C++ Standard versions, I will explore almost all new and updated C++ features that come with the C++23 standard. C++23 is not as big of an update as C++20 was, but it does contain numerous new and updated features to both the core language and the Standard Library. The goal of this session is not to discuss all new and changed features in detail, as that is not possible in a one-hour session. Instead, at the end of the session, you should have a high-level overview of everything that's new or changed in C++23, and it might even change how you are using existing features.
The session will touch on the following core language and Standard Library topics.
C++23 core language changes include explicit object parameters (deducing this), if consteval, multidimensional subscript operators, built-in decay copy support, ability to mark unreachable code, support for specifying platform-independent assumptions, named universal character escapes, and more.
C++23 Standard Library changes include string formatting improvements, formatting of entire ranges, standard named modules std and std.compat, new containers flat_map and flat_set, multidimensional span aka mdspan, a standard generator coroutine, monadic operations on optionals, working with stacktraces at run time, many changes to the ranges library, std::expected as an alternative to exceptions, and more.
Throughout the session, the slides will contain references to other CppCon sessions with more details on specific topics.
---
Marc Gregoire
Marc Gregoire is a software project manager and software architect from Belgium. He graduated from the University of Leuven, Belgium, with a degree in "Burgerlijk ingenieur in de computer wetenschappen" (equivalent to a master of science in engineering in computer science). The year after, he received an advanced master’s degree in artificial intelligence, cum laude, at the same university. After his studies, Marc started working for a software consultancy company called Ordina Belgium. As a consultant, he worked for Siemens and Nokia Siemens Networks on critical 2G and 3G software running on Solaris for telecom operators. This required working in international teams stretching from South America and the United States to Europe, the Middle East, Africa, and Asia. Now, Marc is a software architect at Nikon Metrology (www.nikonmetrology.com), a division of Nikon and a leading provider of precision optical instruments, X-ray machines, and metrology solutions for X-ray, CT, and 3-D geometric inspection.
His main expertise is C/C++, specifically Microsoft VC++ and the MFC framework. He has experience in developing C++ programs running 24/7 on Windows and Linux platforms: for example, KNX/EIB home automation software. In addition to C/C++, Marc also likes C#.
---
Videos Filmed & Edited by Bash Films: www.BashFilms.com
KZbin Channel Managed by Digital Medium Ltd: events.digital-medium.co.uk
---
Registration for CppCon: cppcon.org/registration/
#cppcon #cppprogramming #cpp

Пікірлер: 42
@seebee49
@seebee49 2 ай бұрын
Best "what's new" I saw for a new C++ version quick and easy to grasp
@Taivuttaja
@Taivuttaja 2 ай бұрын
Yup! I think that's partially the reason why this guy's been awarded MVP. Renown professionals usually have either great communication skills all across the board, or they are darn good at one specific field of work they've been specializing in. Those who tend to be the prior, usually end up in tasks/roles requiring some form of leadership skills, or dealing with clients one way or the other.
@axelbagi100
@axelbagi100 2 ай бұрын
I really like this "series", instead of looking at a list and manually look at what everything does, I get a summed up good paced, explained lecture, where I can memorize the (for me) more relevant things.
@solmu1037
@solmu1037 2 ай бұрын
Wow after 40 years C++ adds std::print() 👍
@Radioguy00
@Radioguy00 2 ай бұрын
Excellent presentation, well structured with simple example.
@StefaNoneD
@StefaNoneD 2 ай бұрын
Really good and concise talk!
@ABaumstumpf
@ABaumstumpf 2 ай бұрын
9:07 - consteval does not guarantee that it is executed at compiletime - The language still has no notion of compiletime. What is guaranteed is that it is not executed at runtime. And runtime starts with the codepath entering main. Which means it would be entirely fine for a compiler to evaluate the code dynamically when you start the program, but before entering main. (which is kinda funny - seeing the committee trying multiple times but none of the changes guarantee what the developers actually need).
@nitsanbh
@nitsanbh Ай бұрын
That makes me sad
@nitsanbh
@nitsanbh Ай бұрын
Why not make a ‘comptime’ keyword?
@gaurishgangwar
@gaurishgangwar 9 күн бұрын
What's your source for this because I have read everywhere that consteval means guaranteed to be evaluated at compile time?
@pitschquitsch6858
@pitschquitsch6858 2 ай бұрын
the std::unreachable thing is very good!
@cyrilemeka6987
@cyrilemeka6987 2 ай бұрын
I am really digging the unicode explicit name entry(html allows it too) and the format specifications for standard library types, especially std::map, it's giving python vibes.
@Roibarkan
@Roibarkan 5 ай бұрын
47:24 [slide 83] note that I believe that the type of the variable ’c’ in this slide is char, so std::print will be called 13 times.
@marcgregoire
@marcgregoire 3 ай бұрын
Yes, correct, the type of variable 'c' is indeed char. The for-loop loops over all characters of the joined strings.
@lollo863
@lollo863 Ай бұрын
flat_map, amazing!
@Roibarkan
@Roibarkan 5 ай бұрын
30:27 Actually I think extra “characters” will have indeterminate value, not default initialized. If the value-type of the basic_string is char (or wchar_t) then default initialization is indeterminate, so typically the slide is correct
@marcgregoire
@marcgregoire 3 ай бұрын
You are correct, the extra characters will indeed have indeterminate values.
@Roibarkan
@Roibarkan 5 ай бұрын
47:03 [slides 80-82] I believe the elements in the result of slide/chunk/chunk_by are each std::subrange, and not tuples
@marcgregoire
@marcgregoire 3 ай бұрын
The values in the result are indeed ranges, not tuples. This is in contrast with for example ranges::adjacent_view where the value type is a tuple, but for ranges::slide_view, the value type is a (sub)range.
@chel1812
@chel1812 2 ай бұрын
When will they add the override for regex_replace with function type fmt like in other programming languages and in boost library? Several versions of C++ have already been released from 2011, but the problem is not fixed.
@fdwr
@fdwr 2 ай бұрын
32:13 I look forward to fast std::string resizing, since I'm generally just going to overwrite that string with new data anyway or use only a part of it. The best lambda to pass is the nop lambda `result.resize_and_overwrite(newSize, [](char* buffer, size_t count) {});`, and then we essentially get what we all actually asked for in the first place for this feature, which is basically this `result.resize_and_overwrite(newSize);`. If initializing the string data is like painting a picture, then initializing the string data while *inside* the lambda callback is like trying to paint a picture while standing on your head - not good. :b
@tiegerzahn717
@tiegerzahn717 2 ай бұрын
[slide 80] sad, that std::expected didn't get the same monadic functions as std:: optional
@hstrauss2214
@hstrauss2214 11 күн бұрын
std::expected actually does provide the same monadic functions as std::optional and one more (transform_error).
@anon_y_mousse
@anon_y_mousse 2 ай бұрын
It looks like no compiler supports println() and a few other things, unless CE just hasn't been updated. I guess I'll have to build an up to date copy of `gcc` and `clang` to test which is the case. I still can't fathom how anyone could think that the syntax around pretty much all of these string operations were a good idea. Do people just not like operator overloading? Surely that can't be it because multiple operators have been overloaded for all the functional stuff. Consider if you will: string string_to_split { "a string with spaces" }; for ( auto word : string_to_split / ' ' ) println( "{}", word ); // and thus operator/ would split the string around spaces. Would that be such a bad thing.
@ssl3546
@ssl3546 2 ай бұрын
wish C89 had UZ but back then "int" was assumed to be the native int size, so I guess the problem started when LP64 became the norm. not a fan of trimming space after line-continuation -- the language should punish sloppiness.
@rssszz7208
@rssszz7208 2 ай бұрын
Vs code not supporting c++23 now why it's using c++20 something
@3Max
@3Max Ай бұрын
After seeing "multidimensional indices", "import", and "generators", I was fully expecting to see "we did away with those pesky curly braces... just use tab-indents"
@brockdaniel8845
@brockdaniel8845 2 ай бұрын
Module 'std' not found
@Phantom-lr6cs
@Phantom-lr6cs 2 ай бұрын
cuz its not done yet ... if compiler doesn't support c++23 and modules are not done yet module std cannot be imported
@hstrauss2214
@hstrauss2214 11 күн бұрын
The Microsoft compiler already supports this. However, the feature needs to be enabled in the compiler options.
@GrigoryRechistov
@GrigoryRechistov 2 ай бұрын
"Programmers are always surrounded by complexity; we cannot avoid it.... If our basic tool, the language in which we design and code our programs, is also complicated, the language itself becomes part of the problem rather than part of its solution. " - C. A. R. Hoare (1980 Turing Award Lecture)
@AxWarhawk
@AxWarhawk 2 ай бұрын
35:50 I have to say, I really dislike slide 62, especially for demonstration purposes. Instead of the .and_then call, this should really be just a .transform as the result can only be an int. The to_string transformation still looks obnoxious, but it has to be written this way since C++ can't do overload resolution here. Ideally that'd be just .transform(std::to_string). The usage of .or_else here almost defeats the purpose of using an optional in the first place. That line shouldn't be there, instead the following line (the one that consumes result) would be something like result.value_or("No Integer"). Again, I get that this is meant to show off .and_then, .transform, .or_else, but this really does a bad job in my opinion.
@yaroslavpanych2067
@yaroslavpanych2067 2 ай бұрын
Okay, multi indexed operator if freaking epic fail. It freaking introduces so many ambiguities, idk if i want it at all. It was enough for me when they got rid of trigraphs
@Minty_Meeo
@Minty_Meeo 2 ай бұрын
You liked trigraphs??
@rssszz7208
@rssszz7208 2 ай бұрын
Import std; also not working
@Phantom-lr6cs
@Phantom-lr6cs 20 күн бұрын
it's not done yet and compilers didn't implement those modules for this time
@youtou252
@youtou252 2 ай бұрын
those ads at the beginning convinced me never to come to a cppcon event
@ElPikacupacabra
@ElPikacupacabra 2 ай бұрын
The language is too big. The standards committee should focus on a smaller, better thought out, set of features.
@DuiniRiluz
@DuiniRiluz 2 ай бұрын
Assembly easy than this fu...sh... Don't keep pinching anymore.
@aniketbisht2823
@aniketbisht2823 Ай бұрын
Assembly "language" might be simple but you can't use it for building performance scalable abstractions. If anything C++ has gotten simpler with subsequent standards. Yes, you read that right simpler. Large part of complexity in C++ is/was due to the fact that it wasn't flexible enough for people to solve complex problems in a straightforward manner. But it was possible, resulting in ugly and complicated code.
Back to Basics: Testing in C++ - Phil Nash - CppCon 2023
1:02:33
【獨生子的日常】让小奶猫也体验一把鬼打墙#小奶喵 #铲屎官的乐趣
00:12
“獨生子的日常”YouTube官方頻道
Рет қаралды 106 МЛН
[Vowel]물고기는 물에서 살아야 해🐟🤣Fish have to live in the water #funny
00:53
C++ Weekly - Ep 421 - You're Using optional, variant, pair, tuple, any, and expected Wrong!
10:34
The Downsides Of C++ | Prime Reacts
21:23
ThePrimeTime
Рет қаралды 122 М.
Let's get comfortable with SFINAE (C++)
35:55
platis.solutions
Рет қаралды 2,6 М.
Google I/O 2024: Everything Revealed in 12 Minutes
11:27
unique_ptr: C++'s simplest smart pointer
11:54
mCoding
Рет қаралды 38 М.
C++ Weekly - Ep 422 - Moving from C++20 to C++23
13:38
C++ Weekly With Jason Turner
Рет қаралды 8 М.
How about that uh?😎 #sneakers #airpods
0:13
Side Sphere
Рет қаралды 8 МЛН
СЛОМАЛСЯ ПК ЗА 2000$🤬
0:59
Корнеич
Рет қаралды 2,2 МЛН
Как открыть дверь в Jaecoo J8? Удобно?🤔😊
0:27
Суворкин Сергей
Рет қаралды 1,2 МЛН
Готовый миниПК от Intel (но от китайцев)
36:25
How Neuralink Works 🧠
0:28
Zack D. Films
Рет қаралды 27 МЛН