Youtube - CppCon 2014 Herb Sutter Back to the Basics! Essentials of Modern C++ Style
https://www.youtube.com/watch?v=xnqTKD8uD64
02:38

NĂșmero de desenvolvedores que estĂŁo diretamente envolvidos em cada standard library em C++. CLang eram apenas duas atĂ© pouco tempo!!!
Gnu GCC (libstdc++) - em 20 anos, cerca de 30 desenvolvedores
CLang (libc++) - até dois meses antecedentes à época da publicação da palestra eram apenas 2 desenvolvedores diretamente envolvidos (atualmente 5 a 7 ativos)
Boost - cerca de 300, sem nĂșmero exato.
Loop, range for
09:08

10:33

Why you do this:
for (auto i = begin(c) ; i != end(c)) ; i++ {...use(*c*) ....}
when you can do this
for (auto& e : c) { ... use(e) ... }
and soon this
for (e : c ) { ... use(e) ... }
Smart Pointers
12:14

13:33

14:44

16:52

17:05

17:54

17:56

18:45


How to we pass smart pointers?
19:06

22:26

22:44

23:50

24:37

25:35

27:30

27:44

LetÂŽs talk about auto
30:04

vocĂȘ pode usar auto e ainda sim explicitar o tipo

32:59

Why deduce?
34:19

35:19

37:26

38:21

38:37

38:57

39:37

41:18

41:48


45:09

46:54

47:50


49:32

50:22

50:45

51:17

53:15


Observation âNew features get overused.â â B. Stroustrup or âItâs about the Ivalues, after alllâ âS. Meyers
Just as exception safety isnât all about writing try and catch, using move semantics isnât all about writing move and &&
54:48

Up Front: Acknowledgments & Hat Tips » The following is the result of recent discussions with many people, including but not limited to the following: » Gabriel Dos Reis » Matthew Fiovarante (&& param = move from) » Howard Hinnant (distinguish copy ctor/op= costs vs. move) » StephanT. Lavavej (low cost of value return even in C++98) » Scott Meyers (reduce #objects, be aware of costs ) » Eric Niebler » Sean Parent » Bjarne Stroustrup (practicality, judgment, design sense) » VC+ MVP discussion list » & many more
55:22

57:32

58:59

59:05

01:01:38

01:03:15

01:03:54

01:05:23

setName ?
01:06:47


01:07:50

01:09:33

A segunda função que usa rvalue pode ser noexcept, pois não existe alocação de memória
01:11:58

setName otimizado,
#performance A função não pode ser virtual e tem que estar no header, use com cautela somente em situaçÔes que a performance seja extremamente necessåria.
Perfect Forwarding Idiom
01:15:21

01:19:10




01:23:34

01:25:04

01:25:50


Pass by value for constructors
01:25:49

#best-practices #efficiency #performance ItÂŽs always a good idea pass by value for constructors
- Constructors are the primary case of multiple âin + retain copyâ params, where overloading const&/&& is combinatorial.
- Constructors always construct, so no worries about reusing existing capacity.
- Note: Probably prefer not to write the misleading ânoexpectâ...
Default
01:26:57


forwarding reference
01:27:12

01:29:18

01:31:10

01:31:24


01:33:17
