Тёмный

CppCon 2017: Jason Turner “Practical C++17” 

CppCon
Подписаться 153 тыс.
Просмотров 55 тыс.
50% 1

CppCon.org
-
Presentation Slides, PDFs, Source Code and other presenter materials are available at: github.com/Cpp...
-
C++17 adds many new features: structured bindings, deduction guides, if-init expressions, fold expressions, if constexpr, and enhanced constexpr support in the standard library. Each of these features are interesting, but what will be their cumulative effect on real code? We'll explore how each feature may (or may not) help in real code for enhanced readability, compile time performance and runtime performance.
-
Jason Turner: Developer, Trainer, Speaker
Host of C++Weekly / jasonturner-lefticus , Co-host of CppCast cppcast.com, Co-creator and maintainer of the embedded scripting language for C++, ChaiScript chaiscript.com, and author and curator of the forkable coding standards document cppbestpractice....
I'm available for contracting and onsite training.
-
Videos Filmed & Edited by Bash Films: www.BashFilms.com
*-----*
Register Now For CppCon 2022: cppcon.org/reg...
*-----*

Опубликовано:

 

28 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 48   
@jankodedic3130
@jankodedic3130 7 лет назад
Great talk by JSON, as always!
@jaybee9054
@jaybee9054 Год назад
constexpr JSON noexcept
@sonulohani
@sonulohani 7 лет назад
Thanks to this channel for sharing such an awesome presentations. Very much appreciated.
@thelatestartosrs
@thelatestartosrs 2 года назад
37:40 IMO it is a flaw right? it stops NRVO as he explained before and the simple way to fix it (in the language) is to replace instances of usage of the binding variable names with the binding value. like instead of `auto& value = e.second; f(value); return value;` just do `f(e.second); return e.second;`
@zhivkobogdanov2845
@zhivkobogdanov2845 3 года назад
As an addition to what has been mentioned @35:40 it is also correct to move the value on return if you take the same value by rvalue reference and modify it within a function, as mentioned in another CppCon talk.
@AJlex100500
@AJlex100500 7 лет назад
I don't understand why the code at 47:51 should compile. Afaik std::string_view is not convertible to std::string, therefore constructing m_string from sv is not possible. So what gives?
@SebastianHasler
@SebastianHasler 7 лет назад
string_view is not implicity-convertible to string, but the initializer list can call explicit constructors.
@AJlex100500
@AJlex100500 7 лет назад
Thanks for the answer, I didn't realize string had an explicit constructor from string_view.
@maru7768
@maru7768 6 лет назад
Drinking game! Have a shot every time he says "thing"
@UneededStudios
@UneededStudios 6 лет назад
namespace ParentNamespace:: {} ? @ 9:00
@defense200x
@defense200x 5 лет назад
its a nested namespace
4 года назад
if constexpr is pure happiness.
@yackawaytube
@yackawaytube 4 года назад
I understand every single slide here, but I am not a C++ Jedi yet
@Jimmy9Bazooka
@Jimmy9Bazooka 5 лет назад
@ 41:02 "It is doing exactly what I needed to do and is correct". Sorry, no, it's not correct. You have no unexpanded parameter pack there. "node" parameter should have been "const AST_Node_Impl*... node" for your fold expression to compile.
@OMGclueless
@OMGclueless 4 года назад
Presumably T is a parameter pack here. Confusing because it's named "T" instead of "Ts" or something, and the template parameter definitions were chopped off in his snippet, but I think that's what's going on and in that case it's fine.
@KulaGGin
@KulaGGin 2 года назад
"By your leave, Mr. Turner"🏴‍☠
@joe-ti8rz
@joe-ti8rz 6 лет назад
Perspective. I understand more of The game of thrones than of this talk. Il still win.
@nmmm2000
@nmmm2000 7 лет назад
Great talk, I love it. This is why I do not use C++17 yet. Second reason is lack of standard compiler support in CentOS 6
@llothar68
@llothar68 6 лет назад
Compiler support is pretty good. But the tools are much much slower to pick up then the naked compiler. std::string_view on gcc is still crashing gdb
@nmmm2000
@nmmm2000 6 лет назад
on centos 7, there is gcc 4.8, nothing new, unless you compile it yourself.
@timoleksii
@timoleksii 5 лет назад
@@nmmm2000 have you considered using devtoolset?
@seditt5146
@seditt5146 4 года назад
@@nmmm2000 Man that is a shame, it has been two years, do you still not use C++ 17? It is great, by far the best and most stable version of C++ I have ever used. I can not express how great CTAD is for a programmer. The code looks so much cleaner as well not having to have ugly template brackets all over all templated calls
@traxooza
@traxooza 3 года назад
15:48 How about noexcept_cast ? :D
@fvzaur
@fvzaur 5 лет назад
gotta watch this one
@crystalgames
@crystalgames 6 лет назад
thanks)
@karolyhorvath7624
@karolyhorvath7624 6 лет назад
I honestly don't get why they added if-init. It looks like a mess and we already have braces { } to create an inner scope.
@JohnLudlow
@JohnLudlow 6 лет назад
I think they're following C#, though C#'s equivalent is (IMHO) cleaner - see docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/is#pattern-matching-with-is It's useful in a few situations, mainly for reducing the variables you have flying around your method. It wasn't that big a deal for his methods because as he said, his methods tend to be short anyway, so the scope impact is minimal. I still think it's marginally more readable with the new version because you don't have a temporary variable, but not a huge difference because the syntax is a little weird to me (though I mostly live in C#...)
@karolyhorvath7624
@karolyhorvath7624 6 лет назад
see what?
@JohnLudlow
@JohnLudlow 6 лет назад
Sorry if I wasn't clear. The link points to the docs for (part of) C#'s implementation of a similar feature, which has proved useful in some situations. Of course, I linked to the docs for the specific case which I've used (the broader description is here: docs.microsoft.com/en-us/dotnet/csharp/pattern-matching ) and in the doc I linked to, there wasn't an anchor that led straight to the code example that would have made it make sense - you have to scroll down a little for that. Sorry about that Edit: Damn RU-vid and URL highlighting
@karolyhorvath7624
@karolyhorvath7624 6 лет назад
I don't see any similar feature. Either be very specific, or (preferably) leave me out of this nonsense.
@JohnLudlow
@JohnLudlow 6 лет назад
Uhm, Ok
Далее
C++ Code Smells - Jason Turner - CppCon 2019
58:35
Просмотров 78 тыс.
CppCon 2017: Chandler Carruth “Going Nowhere Faster”
1:00:58
100 Identical Twins Fight For $250,000
35:40
Просмотров 44 млн
Трудности СГОРЕВШЕЙ BMW M4!
49:41
Просмотров 1,5 млн
Новый вид животных Supertype
00:59
Просмотров 193 тыс.
CppCon 2019: Jason Turner “The Best Parts of C++"
58:36
Solving distributed systems challenges in Rust
3:15:52
Просмотров 242 тыс.
C++ Code Smells - Jason Turner
56:11
Просмотров 77 тыс.
Premature Optimization
12:39
Просмотров 810 тыс.