SlideShare a Scribd company logo
1 of 141
Download to read offline
Modern C++ - Why and What
JLM Charedi Tech Meetup
Yehezkel Bernat - YehezkelShB@gmail.com
Thunderbolt
TM SW team, Intel
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Agenda
Modern C++ - Meaning
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Agenda
Modern C++ - Meaning
To make sure we use the same terminology
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Agenda
Modern C++ - Meaning
To make sure we use the same terminology
Modern C++ - Why?
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Agenda
Modern C++ - Meaning
To make sure we use the same terminology
Modern C++ - Why?
To make you interested in C++
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Agenda
Modern C++ - Meaning
To make sure we use the same terminology
Modern C++ - Why?
To make you interested in C++
Modern C++ - What?
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Agenda
Modern C++ - Meaning
To make sure we use the same terminology
Modern C++ - Why?
To make you interested in C++
Modern C++ - What?
To give you a taste of what is possible
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Agenda
Modern C++ - Meaning
To make sure we use the same terminology
Modern C++ - Why?
To make you interested in C++
Modern C++ - What?
To give you a taste of what is possible
Not your father's C++
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Agenda
Modern C++ - Meaning
To make sure we use the same terminology
Modern C++ - Why?
To make you interested in C++
Modern C++ - What?
To give you a taste of what is possible
Not your father's C++
(Herb Sutter's title for a presentation in Lang.NEXT 2012)
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
Outline
Part I
Modern C++ - Meaning
1 What it means Modern C++?
New standards
Not just the standards
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
Outline
1 What it means Modern C++?
New standards
Not just the standards
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
Slow start. . .
The language started in '79
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
Slow start. . .
The language started in '79
Other impotant points in the language history:
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
Slow start. . .
The language started in '79
Other impotant points in the language history:
'85 - 1
st edition of TCPL
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
Slow start. . .
The language started in '79
Other impotant points in the language history:
'85 - 1
st edition of TCPL
'87 - Support in GCC
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
Slow start. . .
The language started in '79
Other impotant points in the language history:
'85 - 1
st edition of TCPL
'87 - Support in GCC
'90 - ARM - The Annotated C++ Reference Manual (de-facto
standard)
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
Slow start. . .
The language started in '79
Other impotant points in the language history:
'85 - 1
st edition of TCPL
'87 - Support in GCC
'90 - ARM - The Annotated C++ Reference Manual (de-facto
standard)
'91 - ISO C++ Commitee founded
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
Slow start. . .
The language started in '79
Other impotant points in the language history:
'85 - 1
st edition of TCPL
'87 - Support in GCC
'90 - ARM - The Annotated C++ Reference Manual (de-facto
standard)
'91 - ISO C++ Commitee founded
'92 - STL implemented
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
Slow start. . .
The language started in '79
Other impotant points in the language history:
'85 - 1
st edition of TCPL
'87 - Support in GCC
'90 - ARM - The Annotated C++ Reference Manual (de-facto
standard)
'91 - ISO C++ Commitee founded
'92 - STL implemented
'98 - C++98
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
Slow start. . .
The language started in '79
Other impotant points in the language history:
'85 - 1
st edition of TCPL
'87 - Support in GCC
'90 - ARM - The Annotated C++ Reference Manual (de-facto
standard)
'91 - ISO C++ Commitee founded
'92 - STL implemented
'98 - C++98
'98 - 3
rd edition of TCPL
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
Slow start. . .
The language started in '79
Other impotant points in the language history:
'85 - 1
st edition of TCPL
'87 - Support in GCC
'90 - ARM - The Annotated C++ Reference Manual (de-facto
standard)
'91 - ISO C++ Commitee founded
'92 - STL implemented
'98 - C++98
'98 - 3
rd edition of TCPL
'99 - Boost started
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
Slow start. . .
The language started in '79
Other impotant points in the language history:
'85 - 1
st edition of TCPL
'87 - Support in GCC
'90 - ARM - The Annotated C++ Reference Manual (de-facto
standard)
'91 - ISO C++ Commitee founded
'92 - STL implemented
'98 - C++98
'98 - 3
rd edition of TCPL
'99 - Boost started
'03 - C++03
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
Slow start. . .
The language started in '79
Other impotant points in the language history:
'85 - 1
st edition of TCPL
'87 - Support in GCC
'90 - ARM - The Annotated C++ Reference Manual (de-facto
standard)
'91 - ISO C++ Commitee founded
'92 - STL implemented
'98 - C++98
'98 - 3
rd edition of TCPL
'99 - Boost started
'03 - C++03
http://en.cppreference.com/w/cpp/language/history
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
. . . and then (almost full) stop
Compiler support wasn't great
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
. . . and then (almost full) stop
Compiler support wasn't great
nor full
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
. . . and then (almost full) stop
Compiler support wasn't great
nor full
Other languages gained momentum (Java - started '95, C# -
started '02)
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
. . . and then (almost full) stop
Compiler support wasn't great
nor full
Other languages gained momentum (Java - started '95, C# -
started '02)
Vague promises for having C++0x
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
. . . and then (almost full) stop
Compiler support wasn't great
nor full
Other languages gained momentum (Java - started '95, C# -
started '02)
Vague promises for having C++0x
Nothing much meanwhile
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
. . . and then (almost full) stop
Compiler support wasn't great
nor full
Other languages gained momentum (Java - started '95, C# -
started '02)
Vague promises for having C++0x
Nothing much meanwhile
(TR1?)
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
But then it started again!
Standard
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
But then it started again!
Standard
C++11
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
But then it started again!
Standard
C++11
(C++0b?)
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
But then it started again!
Standard
C++11
(C++0b?)
C++14
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
But then it started again!
Standard
C++11
(C++0b?)
C++14
C++17
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
But then it started again!
Standard
C++11
(C++0b?)
C++14
C++17
Many TSes
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
But then it started again!
Standard
C++11
(C++0b?)
C++14
C++17
Many TSes
Compiler support
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
But then it started again!
Standard
C++11
(C++0b?)
C++14
C++17
Many TSes
Compiler support
Even a completly new and shiny compiler, Clang (LLVM based)
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
But then it started again!
Standard
C++11
(C++0b?)
C++14
C++17
Many TSes
Compiler support
Even a completly new and shiny compiler, Clang (LLVM based)
Tool support
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
But then it started again!
Standard
C++11
(C++0b?)
C++14
C++17
Many TSes
Compiler support
Even a completly new and shiny compiler, Clang (LLVM based)
Tool support
IDEs, static and dynamic analyzers, etc.
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Perspective
https://herbsutter.com/2016/06/30/trip-report-summer-iso-c-standards-meeting-oulu/
What it means Modern C++?
New standards
Not just the standards
Outline
1 What it means Modern C++?
New standards
Not just the standards
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
Not only 'what', it's also about the 'how'
C++ Core Guidelines
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
Not only 'what', it's also about the 'how'
C++ Core Guidelines
http://isocpp.github.io/CppCoreGuidelines/
CppCoreGuidelines
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
Not only 'what', it's also about the 'how'
C++ Core Guidelines
http://isocpp.github.io/CppCoreGuidelines/
CppCoreGuidelines
Scott Meyers' Eective C++ series
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
Not only 'what', it's also about the 'how'
C++ Core Guidelines
http://isocpp.github.io/CppCoreGuidelines/
CppCoreGuidelines
Scott Meyers' Eective C++ series
Eective C++ (3
rd ed.), More Eective C++, Eective STL,
Eective Modern C++
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
Not only 'what', it's also about the 'how'
C++ Core Guidelines
http://isocpp.github.io/CppCoreGuidelines/
CppCoreGuidelines
Scott Meyers' Eective C++ series
Eective C++ (3
rd ed.), More Eective C++, Eective STL,
Eective Modern C++
More. . .
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
What it means Modern C++?
New standards
Not just the standards
Not only 'what', it's also about the 'how'
C++ Core Guidelines
http://isocpp.github.io/CppCoreGuidelines/
CppCoreGuidelines
Scott Meyers' Eective C++ series
Eective C++ (3
rd ed.), More Eective C++, Eective STL,
Eective Modern C++
More. . .
Generally: the common wisdom the C++ developer
community collected over the years
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Wasn't C++ dead years ago?
Aren't managed languages all what we need?
Outline
Part II
Modern C++ - Why?
2 Wasn't C++ dead years ago?
3 Aren't managed languages all what we need?
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Wasn't C++ dead years ago?
Aren't managed languages all what we need?
Outline
2 Wasn't C++ dead years ago?
3 Aren't managed languages all what we need?
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Wasn't C++ dead years ago?
Aren't managed languages all what we need?
The Free Lunch Is Over
In '05, Herb Sutter wrote an article titled The Free Lunch Is
Over: A Fundamental Turn Toward Concurrency in Software
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Wasn't C++ dead years ago?
Aren't managed languages all what we need?
The Free Lunch Is Over
In '05, Herb Sutter wrote an article titled The Free Lunch Is
Over: A Fundamental Turn Toward Concurrency in Software
http:
//www.gotw.ca/publications/concurrency-ddj.htm
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Wasn't C++ dead years ago?
Aren't managed languages all what we need?
The Free Lunch Is Over
In '05, Herb Sutter wrote an article titled The Free Lunch Is
Over: A Fundamental Turn Toward Concurrency in Software
http:
//www.gotw.ca/publications/concurrency-ddj.htm
Key observation was simply looking at the following graph:
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
CPU graph
Wasn't C++ dead years ago?
Aren't managed languages all what we need?
Why C++
No free lunch
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Wasn't C++ dead years ago?
Aren't managed languages all what we need?
Why C++
No free lunch
One conclusion is that concurrency and parallelism became
very important to utilize the CPU advancement
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Wasn't C++ dead years ago?
Aren't managed languages all what we need?
Why C++
No free lunch
One conclusion is that concurrency and parallelism became
very important to utilize the CPU advancement
Another conclusion, as Sutter explained in C++ and Beyond
2011, is that we care again about performance
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Wasn't C++ dead years ago?
Aren't managed languages all what we need?
Why C++
No free lunch
One conclusion is that concurrency and parallelism became
very important to utilize the CPU advancement
Another conclusion, as Sutter explained in C++ and Beyond
2011, is that we care again about performance
Performance per Watt
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Wasn't C++ dead years ago?
Aren't managed languages all what we need?
Why C++
No free lunch
One conclusion is that concurrency and parallelism became
very important to utilize the CPU advancement
Another conclusion, as Sutter explained in C++ and Beyond
2011, is that we care again about performance
Performance per Watt
Both mobile and datacenters
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Wasn't C++ dead years ago?
Aren't managed languages all what we need?
Why C++
No free lunch
One conclusion is that concurrency and parallelism became
very important to utilize the CPU advancement
Another conclusion, as Sutter explained in C++ and Beyond
2011, is that we care again about performance
Performance per Watt
Both mobile and datacenters
Performance per Size
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Wasn't C++ dead years ago?
Aren't managed languages all what we need?
Why C++
No free lunch
One conclusion is that concurrency and parallelism became
very important to utilize the CPU advancement
Another conclusion, as Sutter explained in C++ and Beyond
2011, is that we care again about performance
Performance per Watt
Both mobile and datacenters
Performance per Size
Performace per Cycle
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Wasn't C++ dead years ago?
Aren't managed languages all what we need?
Why C++
No free lunch
One conclusion is that concurrency and parallelism became
very important to utilize the CPU advancement
Another conclusion, as Sutter explained in C++ and Beyond
2011, is that we care again about performance
Performance per Watt
Both mobile and datacenters
Performance per Size
Performace per Cycle
Do more with the same for better experience
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Wasn't C++ dead years ago?
Aren't managed languages all what we need?
Outline
2 Wasn't C++ dead years ago?
3 Aren't managed languages all what we need?
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Wasn't C++ dead years ago?
Aren't managed languages all what we need?
Aren't managed languages all what we need?
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Wasn't C++ dead years ago?
Aren't managed languages all what we need?
Aren't managed languages all what we need?
Nope
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Wasn't C++ dead years ago?
Aren't managed languages all what we need?
More seriously
Depends on what we are optimizing for
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Wasn't C++ dead years ago?
Aren't managed languages all what we need?
More seriously
Depends on what we are optimizing for
The usual trade-o (no, not space/time trade-o)
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Wasn't C++ dead years ago?
Aren't managed languages all what we need?
More seriously
Depends on what we are optimizing for
The usual trade-o (no, not space/time trade-o)
Developer/development time - Managed
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Wasn't C++ dead years ago?
Aren't managed languages all what we need?
More seriously
Depends on what we are optimizing for
The usual trade-o (no, not space/time trade-o)
Developer/development time - Managed
Performance - Unmanaged
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Wasn't C++ dead years ago?
Aren't managed languages all what we need?
More seriously
Depends on what we are optimizing for
The usual trade-o (no, not space/time trade-o)
Developer/development time - Managed
Performance - Unmanaged
(Compatibility is also a big win for C++, but that isn't new)
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Wasn't C++ dead years ago?
Aren't managed languages all what we need?
More seriously
Depends on what we are optimizing for
The usual trade-o (no, not space/time trade-o)
Developer/development time - Managed
Performance - Unmanaged
(Compatibility is also a big win for C++, but that isn't new)
What it means Managed / Unmanaged?
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
Outline
Part III
Modern C++ - What?
4 But C++ is not the right choice anyway
5 Isn't C++ very hard to use?
6 Isn't C++ very unsafe to use?
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
Outline
4 But C++ is not the right choice anyway
5 Isn't C++ very hard to use?
6 Isn't C++ very unsafe to use?
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
What are the main pain points you have about C++?
Here are (some of) mine:
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
What are the main pain points you have about C++?
Here are (some of) mine:
Usability issues:
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
What are the main pain points you have about C++?
Here are (some of) mine:
Usability issues:
Hard-to-spell long template instantiation types
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
What are the main pain points you have about C++?
Here are (some of) mine:
Usability issues:
Hard-to-spell long template instantiation types
const std::setstd::mapstd::string, std::pair
int, std::vectordouble::iterator::const_iterator
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
What are the main pain points you have about C++?
Here are (some of) mine:
Usability issues:
Hard-to-spell long template instantiation types
const std::setstd::mapstd::string, std::pair
int, std::vectordouble::iterator::const_iterator
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
What are the main pain points you have about C++?
Here are (some of) mine:
Usability issues:
Hard-to-spell long template instantiation types
const std::setstd::mapstd::string, std::pair
int, std::vectordouble::iterator::const_iterator
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
What are the main pain points you have about C++?
Here are (some of) mine:
Usability issues:
Hard-to-spell long template instantiation types
const std::setstd::mapstd::string, std::pair
int, std::vectordouble::iterator::const_iterator
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
What are the main pain points you have about C++?
Here are (some of) mine:
Usability issues:
Hard-to-spell long template instantiation types
const std::setstd::mapstd::string, std::pair
int, std::vectordouble::iterator::const_iterator
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
What are the main pain points you have about C++?
Here are (some of) mine:
Usability issues:
Hard-to-spell long template instantiation types
const std::setstd::mapstd::string, std::pair
int, std::vectordouble::iterator::const_iterator
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
What are the main pain points you have about C++?
Here are (some of) mine:
Usability issues:
Hard-to-spell long template instantiation types
Writing explicit loops
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
What are the main pain points you have about C++?
Here are (some of) mine:
Usability issues:
Hard-to-spell long template instantiation types
Writing explicit loops
Example: 01-ExplicitLoops.cpp
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
What are the main pain points you have about C++?
Here are (some of) mine:
Usability issues:
Hard-to-spell long template instantiation types
Writing explicit loops
Example: 01-ExplicitLoops.cpp
Inconsistency (e.g. initializing struct vs. class vs. array vs.
container)
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
What are the main pain points you have about C++?
Here are (some of) mine:
Usability issues:
Hard-to-spell long template instantiation types
Writing explicit loops
Example: 01-ExplicitLoops.cpp
Inconsistency (e.g. initializing struct vs. class vs. array vs.
container)
Example: 02-InitDierences.cpp (rst part)
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
What are the main pain points you have about C++?
Here are (some of) mine:
Usability issues:
Hard-to-spell long template instantiation types
Writing explicit loops
Example: 01-ExplicitLoops.cpp
Inconsistency (e.g. initializing struct vs. class vs. array vs.
container)
Example: 02-InitDierences.cpp (rst part)
Safety issues:
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
What are the main pain points you have about C++?
Here are (some of) mine:
Usability issues:
Hard-to-spell long template instantiation types
Writing explicit loops
Example: 01-ExplicitLoops.cpp
Inconsistency (e.g. initializing struct vs. class vs. array vs.
container)
Example: 02-InitDierences.cpp (rst part)
Safety issues:
Pointers are dangerous
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
What are the main pain points you have about C++?
Here are (some of) mine:
Usability issues:
Hard-to-spell long template instantiation types
Writing explicit loops
Example: 01-ExplicitLoops.cpp
Inconsistency (e.g. initializing struct vs. class vs. array vs.
container)
Example: 02-InitDierences.cpp (rst part)
Safety issues:
Pointers are dangerous
Explicit memory handling (no garbage collector)
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
What are the main pain points you have about C++?
Here are (some of) mine:
Usability issues:
Hard-to-spell long template instantiation types
Writing explicit loops
Example: 01-ExplicitLoops.cpp
Inconsistency (e.g. initializing struct vs. class vs. array vs.
container)
Example: 02-InitDierences.cpp (rst part)
Safety issues:
Pointers are dangerous
Explicit memory handling (no garbage collector)
Implicit conversions
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
Outline
4 But C++ is not the right choice anyway
5 Isn't C++ very hard to use?
6 Isn't C++ very unsafe to use?
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
Easier-to-use added features
We'll present here a few features of modern C++
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
Easier-to-use added features
We'll present here a few features of modern C++
Most of them made the language easier to use
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
Easier-to-use added features
We'll present here a few features of modern C++
Most of them made the language easier to use
Usually they improve safety too
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
Easier-to-use added features
We'll present here a few features of modern C++
Most of them made the language easier to use
Usually they improve safety too
Sometimes they also improve performance (but in no case hurt
performance)
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
auto
auto
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
auto
auto
AAA - Almost Always Auto
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
auto
auto
AAA - Almost Always Auto
(Improved in C++17 with copy elision guarantee and not
deducing initializer-list)
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
auto
auto
AAA - Almost Always Auto
(Improved in C++17 with copy elision guarantee and not
deducing initializer-list)
It's also about performance
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
auto
auto
AAA - Almost Always Auto
(Improved in C++17 with copy elision guarantee and not
deducing initializer-list)
It's also about performance
Prevents hidden implicit copy (Eective Modern C++, Scott
Meyers)
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
auto
auto
AAA - Almost Always Auto
(Improved in C++17 with copy elision guarantee and not
deducing initializer-list)
It's also about performance
Prevents hidden implicit copy (Eective Modern C++, Scott
Meyers)
std::mapstd::string, int m;
// Fill with data ...
for (auto i = m.begin(); i != m.end(); ++i)
{
const std::pairstd::string, int entry = *i;
// Work with entry
}
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
auto
auto
AAA - Almost Always Auto
(Improved in C++17 with copy elision guarantee and not
deducing initializer-list)
It's also about performance
Prevents hidden implicit copy (Eective Modern C++, Scott
Meyers)
It's actually also about safety
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
auto
auto
AAA - Almost Always Auto
(Improved in C++17 with copy elision guarantee and not
deducing initializer-list)
It's also about performance
Prevents hidden implicit copy (Eective Modern C++, Scott
Meyers)
It's actually also about safety
Better maintainability, esp. with refactoring; better generic
code
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
auto
auto
AAA - Almost Always Auto
(Improved in C++17 with copy elision guarantee and not
deducing initializer-list)
It's also about performance
Prevents hidden implicit copy (Eective Modern C++, Scott
Meyers)
It's actually also about safety
Better maintainability, esp. with refactoring; better generic
code
(We'll see it in use in the following code examples)
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
Better loops
Range-based for loops
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
Better loops
Range-based for loops
Example: 01-ExplicitLoops-RangeBased.cpp
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
Better loops
Range-based for loops
Example: 01-ExplicitLoops-RangeBased.cpp
Algorithms are better (loops with name and explicit intention)
- but harder to use!
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
Better loops
Range-based for loops
Example: 01-ExplicitLoops-RangeBased.cpp
Algorithms are better (loops with name and explicit intention)
- but harder to use!
Example: 01-ExplicitLoops-Algorithms.cpp
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
Better loops
Range-based for loops
Example: 01-ExplicitLoops-RangeBased.cpp
Algorithms are better (loops with name and explicit intention)
- but harder to use!
Example: 01-ExplicitLoops-Algorithms.cpp
Lambda functions - make algorithms usable
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
Better loops
Range-based for loops
Example: 01-ExplicitLoops-RangeBased.cpp
Algorithms are better (loops with name and explicit intention)
- but harder to use!
Example: 01-ExplicitLoops-Algorithms.cpp
Lambda functions - make algorithms usable
Example: 01-ExplicitLoops-Lambdas.cpp
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
Better initialization
Brace initializers (e.g. no discrimination against init of
member structs and arrays; init of containers)
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
Better initialization
Brace initializers (e.g. no discrimination against init of
member structs and arrays; init of containers)
In-class initializers
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
Better initialization
Brace initializers (e.g. no discrimination against init of
member structs and arrays; init of containers)
In-class initializers
Example: 02-InitDierences.cpp (second part)
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
Better information passing
std::tuple
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
Better information passing
std::tuple
(C# is catching up with C#7)
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
Better information passing
std::tuple
(C# is catching up with C#7)
Further expanded by structured binding in C++17
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
Outline
4 But C++ is not the right choice anyway
5 Isn't C++ very hard to use?
6 Isn't C++ very unsafe to use?
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
One safety mechanism to rule them all
RAII
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
One safety mechanism to rule them all
RAII
Solves both resource safety issues and exception safety issues
(e.g. auto reset a ag)
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
One safety mechanism to rule them all
RAII
Solves both resource safety issues and exception safety issues
(e.g. auto reset a ag)
Smart pointers
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
One safety mechanism to rule them all
RAII
Solves both resource safety issues and exception safety issues
(e.g. auto reset a ag)
Smart pointers
Example: SmartPointers.sln
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
One safety mechanism to rule them all
RAII
Solves both resource safety issues and exception safety issues
(e.g. auto reset a ag)
Smart pointers
Example: SmartPointers.sln
Example: RAII
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
One safety mechanism to rule them all
RAII
Solves both resource safety issues and exception safety issues
(e.g. auto reset a ag)
Smart pointers
Example: SmartPointers.sln
Example: RAII
More RAII tools (STL, fstream, lock_guard)
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
One safety mechanism to rule them all
RAII
Solves both resource safety issues and exception safety issues
(e.g. auto reset a ag)
Smart pointers
Example: SmartPointers.sln
Example: RAII
More RAII tools (STL, fstream, lock_guard)
Scope guard
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
One safety mechanism to rule them all
RAII
Solves both resource safety issues and exception safety issues
(e.g. auto reset a ag)
Smart pointers
Example: SmartPointers.sln
Example: RAII
More RAII tools (STL, fstream, lock_guard)
Scope guard
Example: ScopeGuard
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
Another interesting safety mechanism
Mars land vehicle story
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
Another interesting safety mechanism
Mars land vehicle story
https://en.wikipedia.org/wiki/Mars_Climate_Orbiter
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
Another interesting safety mechanism
Mars land vehicle story
https://en.wikipedia.org/wiki/Mars_Climate_Orbiter
UDLs
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
Another interesting safety mechanism
Mars land vehicle story
https://en.wikipedia.org/wiki/Mars_Climate_Orbiter
UDLs
Bjarne Stroustrup's talk, slides 18-23
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
But C++ is not the right choice anyway
Isn't C++ very hard to use?
Isn't C++ very unsafe to use?
Another interesting safety mechanism
Mars land vehicle story
https://en.wikipedia.org/wiki/Mars_Climate_Orbiter
UDLs
Bjarne Stroustrup's talk, slides 18-23
Example: UDLs
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Outline
Part IV
Summary
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Summary
We discussed:
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Summary
We discussed:
Why
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Summary
We discussed:
Why
(A bit of) What
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
Outline
Part V
References
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
References
C++ Today: The Beast Is Back; Ga²per Aºman, Jon Kalb;
http:
//www.oreilly.com/programming/free/c++-today.csp
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
References
C++ Today: The Beast Is Back; Ga²per Aºman, Jon Kalb;
http:
//www.oreilly.com/programming/free/c++-today.csp
Elements of Modern C++ Style; Herb Sutter;
https://herbsutter.com/elements-of-modern-c-style/
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
References
C++ Today: The Beast Is Back; Ga²per Aºman, Jon Kalb;
http:
//www.oreilly.com/programming/free/c++-today.csp
Elements of Modern C++ Style; Herb Sutter;
https://herbsutter.com/elements-of-modern-c-style/
C++ Super-FAQ; https://isocpp.org/faq
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
References
C++ Today: The Beast Is Back; Ga²per Aºman, Jon Kalb;
http:
//www.oreilly.com/programming/free/c++-today.csp
Elements of Modern C++ Style; Herb Sutter;
https://herbsutter.com/elements-of-modern-c-style/
C++ Super-FAQ; https://isocpp.org/faq
C++ reference; http://cppreference.com
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
References
C++ Today: The Beast Is Back; Ga²per Aºman, Jon Kalb;
http:
//www.oreilly.com/programming/free/c++-today.csp
Elements of Modern C++ Style; Herb Sutter;
https://herbsutter.com/elements-of-modern-c-style/
C++ Super-FAQ; https://isocpp.org/faq
C++ reference; http://cppreference.com
C++ Core Guidelines; http://isocpp.github.io/
CppCoreGuidelines/CppCoreGuidelines
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
References
C++ Today: The Beast Is Back; Ga²per Aºman, Jon Kalb;
http:
//www.oreilly.com/programming/free/c++-today.csp
Elements of Modern C++ Style; Herb Sutter;
https://herbsutter.com/elements-of-modern-c-style/
C++ Super-FAQ; https://isocpp.org/faq
C++ reference; http://cppreference.com
C++ Core Guidelines; http://isocpp.github.io/
CppCoreGuidelines/CppCoreGuidelines
Ask me for more references, articles, books and videos
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
References
C++ Today: The Beast Is Back; Ga²per Aºman, Jon Kalb;
http:
//www.oreilly.com/programming/free/c++-today.csp
Elements of Modern C++ Style; Herb Sutter;
https://herbsutter.com/elements-of-modern-c-style/
C++ Super-FAQ; https://isocpp.org/faq
C++ reference; http://cppreference.com
C++ Core Guidelines; http://isocpp.github.io/
CppCoreGuidelines/CppCoreGuidelines
Ask me for more references, articles, books and videos
(or just google it)
Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What

More Related Content

Viewers also liked

Ubuntu - UX copywriting
Ubuntu - UX copywritingUbuntu - UX copywriting
Ubuntu - UX copywritingSteph Wilson
 
You are the best user researcher ever
You are the best user researcher ever You are the best user researcher ever
You are the best user researcher ever Talisa Chang
 
High performance web programming with C++14
High performance web programming with C++14High performance web programming with C++14
High performance web programming with C++14Matthieu Garrigues
 
『アフィリエイト・プログラムに関する意識調査2012』 ama 理事 野崎雷太
『アフィリエイト・プログラムに関する意識調査2012』 ama 理事 野崎雷太『アフィリエイト・プログラムに関する意識調査2012』 ama 理事 野崎雷太
『アフィリエイト・プログラムに関する意識調査2012』 ama 理事 野崎雷太NPOアフィリエイトマーケティング協会
 
Internet Research Presentation
Internet Research PresentationInternet Research Presentation
Internet Research Presentationadeason
 
Lurkers Into Leads: 11 Hacks to Connect with the 99 Percent (The Silent Majo...
Lurkers Into Leads:  11 Hacks to Connect with the 99 Percent (The Silent Majo...Lurkers Into Leads:  11 Hacks to Connect with the 99 Percent (The Silent Majo...
Lurkers Into Leads: 11 Hacks to Connect with the 99 Percent (The Silent Majo...Nick Kellet
 
Using Pleiades Very High Resolution Images for planning activities in feasib...
Using Pleiades  Very High Resolution Images for planning activities in feasib...Using Pleiades  Very High Resolution Images for planning activities in feasib...
Using Pleiades Very High Resolution Images for planning activities in feasib...Argongra Gis
 
Vantagens layout personalizado em sua Loja virtual
Vantagens layout personalizado em sua Loja virtualVantagens layout personalizado em sua Loja virtual
Vantagens layout personalizado em sua Loja virtualScore Media
 
Platform-as-a-Service: Lessons from Manufacturing
Platform-as-a-Service: Lessons from ManufacturingPlatform-as-a-Service: Lessons from Manufacturing
Platform-as-a-Service: Lessons from ManufacturingGordon Haff
 

Viewers also liked (13)

Ubuntu - UX copywriting
Ubuntu - UX copywritingUbuntu - UX copywriting
Ubuntu - UX copywriting
 
第13回アフィリエイトカンファレンス開会挨拶
第13回アフィリエイトカンファレンス開会挨拶第13回アフィリエイトカンファレンス開会挨拶
第13回アフィリエイトカンファレンス開会挨拶
 
You are the best user researcher ever
You are the best user researcher ever You are the best user researcher ever
You are the best user researcher ever
 
High performance web programming with C++14
High performance web programming with C++14High performance web programming with C++14
High performance web programming with C++14
 
『アフィリエイト・プログラムに関する意識調査2012』 ama 理事 野崎雷太
『アフィリエイト・プログラムに関する意識調査2012』 ama 理事 野崎雷太『アフィリエイト・プログラムに関する意識調査2012』 ama 理事 野崎雷太
『アフィリエイト・プログラムに関する意識調査2012』 ama 理事 野崎雷太
 
Internet Research Presentation
Internet Research PresentationInternet Research Presentation
Internet Research Presentation
 
Hermida ash
Hermida ashHermida ash
Hermida ash
 
Pmfail
PmfailPmfail
Pmfail
 
Lurkers Into Leads: 11 Hacks to Connect with the 99 Percent (The Silent Majo...
Lurkers Into Leads:  11 Hacks to Connect with the 99 Percent (The Silent Majo...Lurkers Into Leads:  11 Hacks to Connect with the 99 Percent (The Silent Majo...
Lurkers Into Leads: 11 Hacks to Connect with the 99 Percent (The Silent Majo...
 
Enabling Mission Partners – A Success Story
Enabling Mission Partners – A Success StoryEnabling Mission Partners – A Success Story
Enabling Mission Partners – A Success Story
 
Using Pleiades Very High Resolution Images for planning activities in feasib...
Using Pleiades  Very High Resolution Images for planning activities in feasib...Using Pleiades  Very High Resolution Images for planning activities in feasib...
Using Pleiades Very High Resolution Images for planning activities in feasib...
 
Vantagens layout personalizado em sua Loja virtual
Vantagens layout personalizado em sua Loja virtualVantagens layout personalizado em sua Loja virtual
Vantagens layout personalizado em sua Loja virtual
 
Platform-as-a-Service: Lessons from Manufacturing
Platform-as-a-Service: Lessons from ManufacturingPlatform-as-a-Service: Lessons from Manufacturing
Platform-as-a-Service: Lessons from Manufacturing
 

Similar to Modern C++ Why and What

C++11 Was Only the Beginning
C++11 Was Only the BeginningC++11 Was Only the Beginning
C++11 Was Only the BeginningMateusz Pusz
 
C++: a fast tour of a fast language
C++: a fast tour of a fast languageC++: a fast tour of a fast language
C++: a fast tour of a fast languageAdrian Ostrowski
 
Basic of c++ programming
Basic of c++ programmingBasic of c++ programming
Basic of c++ programmingTalha Mughal
 
Static analysis of C++Builder and WinRT projects
Static analysis of C++Builder and WinRT projectsStatic analysis of C++Builder and WinRT projects
Static analysis of C++Builder and WinRT projectsPVS-Studio
 
C++ In One Day_Nho Vĩnh Share
C++ In One Day_Nho Vĩnh ShareC++ In One Day_Nho Vĩnh Share
C++ In One Day_Nho Vĩnh ShareNho Vĩnh
 
C++ Concepts and Ranges - How to use them?
C++ Concepts and Ranges - How to use them?C++ Concepts and Ranges - How to use them?
C++ Concepts and Ranges - How to use them?Mateusz Pusz
 
Porting To Symbian
Porting To SymbianPorting To Symbian
Porting To SymbianMark Wilcox
 
Lecture01-Introduction-to-C-programming-converted (4).pptx
Lecture01-Introduction-to-C-programming-converted (4).pptxLecture01-Introduction-to-C-programming-converted (4).pptx
Lecture01-Introduction-to-C-programming-converted (4).pptxMdMuaz2
 

Similar to Modern C++ Why and What (11)

C++11 Was Only the Beginning
C++11 Was Only the BeginningC++11 Was Only the Beginning
C++11 Was Only the Beginning
 
Test Driven Interviewing in C++
Test Driven Interviewing in C++Test Driven Interviewing in C++
Test Driven Interviewing in C++
 
C++: a fast tour of a fast language
C++: a fast tour of a fast languageC++: a fast tour of a fast language
C++: a fast tour of a fast language
 
Basic of c++ programming
Basic of c++ programmingBasic of c++ programming
Basic of c++ programming
 
Static analysis of C++Builder and WinRT projects
Static analysis of C++Builder and WinRT projectsStatic analysis of C++Builder and WinRT projects
Static analysis of C++Builder and WinRT projects
 
C++ In One Day_Nho Vĩnh Share
C++ In One Day_Nho Vĩnh ShareC++ In One Day_Nho Vĩnh Share
C++ In One Day_Nho Vĩnh Share
 
C++ Concepts and Ranges - How to use them?
C++ Concepts and Ranges - How to use them?C++ Concepts and Ranges - How to use them?
C++ Concepts and Ranges - How to use them?
 
Porting To Symbian
Porting To SymbianPorting To Symbian
Porting To Symbian
 
Return of c++
Return of c++Return of c++
Return of c++
 
Lecture01-Introduction-to-C-programming-converted (4).pptx
Lecture01-Introduction-to-C-programming-converted (4).pptxLecture01-Introduction-to-C-programming-converted (4).pptx
Lecture01-Introduction-to-C-programming-converted (4).pptx
 
Lecture02
Lecture02Lecture02
Lecture02
 

Recently uploaded

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 

Recently uploaded (20)

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 

Modern C++ Why and What

  • 1. Modern C++ - Why and What JLM Charedi Tech Meetup Yehezkel Bernat - YehezkelShB@gmail.com Thunderbolt TM SW team, Intel Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 2. Agenda Modern C++ - Meaning Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 3. Agenda Modern C++ - Meaning To make sure we use the same terminology Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 4. Agenda Modern C++ - Meaning To make sure we use the same terminology Modern C++ - Why? Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 5. Agenda Modern C++ - Meaning To make sure we use the same terminology Modern C++ - Why? To make you interested in C++ Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 6. Agenda Modern C++ - Meaning To make sure we use the same terminology Modern C++ - Why? To make you interested in C++ Modern C++ - What? Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 7. Agenda Modern C++ - Meaning To make sure we use the same terminology Modern C++ - Why? To make you interested in C++ Modern C++ - What? To give you a taste of what is possible Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 8. Agenda Modern C++ - Meaning To make sure we use the same terminology Modern C++ - Why? To make you interested in C++ Modern C++ - What? To give you a taste of what is possible Not your father's C++ Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 9. Agenda Modern C++ - Meaning To make sure we use the same terminology Modern C++ - Why? To make you interested in C++ Modern C++ - What? To give you a taste of what is possible Not your father's C++ (Herb Sutter's title for a presentation in Lang.NEXT 2012) Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 10. What it means Modern C++? Outline Part I Modern C++ - Meaning 1 What it means Modern C++? New standards Not just the standards Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 11. What it means Modern C++? New standards Not just the standards Outline 1 What it means Modern C++? New standards Not just the standards Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 12. What it means Modern C++? New standards Not just the standards Slow start. . . The language started in '79 Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 13. What it means Modern C++? New standards Not just the standards Slow start. . . The language started in '79 Other impotant points in the language history: Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 14. What it means Modern C++? New standards Not just the standards Slow start. . . The language started in '79 Other impotant points in the language history: '85 - 1 st edition of TCPL Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 15. What it means Modern C++? New standards Not just the standards Slow start. . . The language started in '79 Other impotant points in the language history: '85 - 1 st edition of TCPL '87 - Support in GCC Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 16. What it means Modern C++? New standards Not just the standards Slow start. . . The language started in '79 Other impotant points in the language history: '85 - 1 st edition of TCPL '87 - Support in GCC '90 - ARM - The Annotated C++ Reference Manual (de-facto standard) Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 17. What it means Modern C++? New standards Not just the standards Slow start. . . The language started in '79 Other impotant points in the language history: '85 - 1 st edition of TCPL '87 - Support in GCC '90 - ARM - The Annotated C++ Reference Manual (de-facto standard) '91 - ISO C++ Commitee founded Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 18. What it means Modern C++? New standards Not just the standards Slow start. . . The language started in '79 Other impotant points in the language history: '85 - 1 st edition of TCPL '87 - Support in GCC '90 - ARM - The Annotated C++ Reference Manual (de-facto standard) '91 - ISO C++ Commitee founded '92 - STL implemented Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 19. What it means Modern C++? New standards Not just the standards Slow start. . . The language started in '79 Other impotant points in the language history: '85 - 1 st edition of TCPL '87 - Support in GCC '90 - ARM - The Annotated C++ Reference Manual (de-facto standard) '91 - ISO C++ Commitee founded '92 - STL implemented '98 - C++98 Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 20. What it means Modern C++? New standards Not just the standards Slow start. . . The language started in '79 Other impotant points in the language history: '85 - 1 st edition of TCPL '87 - Support in GCC '90 - ARM - The Annotated C++ Reference Manual (de-facto standard) '91 - ISO C++ Commitee founded '92 - STL implemented '98 - C++98 '98 - 3 rd edition of TCPL Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 21. What it means Modern C++? New standards Not just the standards Slow start. . . The language started in '79 Other impotant points in the language history: '85 - 1 st edition of TCPL '87 - Support in GCC '90 - ARM - The Annotated C++ Reference Manual (de-facto standard) '91 - ISO C++ Commitee founded '92 - STL implemented '98 - C++98 '98 - 3 rd edition of TCPL '99 - Boost started Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 22. What it means Modern C++? New standards Not just the standards Slow start. . . The language started in '79 Other impotant points in the language history: '85 - 1 st edition of TCPL '87 - Support in GCC '90 - ARM - The Annotated C++ Reference Manual (de-facto standard) '91 - ISO C++ Commitee founded '92 - STL implemented '98 - C++98 '98 - 3 rd edition of TCPL '99 - Boost started '03 - C++03 Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 23. What it means Modern C++? New standards Not just the standards Slow start. . . The language started in '79 Other impotant points in the language history: '85 - 1 st edition of TCPL '87 - Support in GCC '90 - ARM - The Annotated C++ Reference Manual (de-facto standard) '91 - ISO C++ Commitee founded '92 - STL implemented '98 - C++98 '98 - 3 rd edition of TCPL '99 - Boost started '03 - C++03 http://en.cppreference.com/w/cpp/language/history Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 24. What it means Modern C++? New standards Not just the standards . . . and then (almost full) stop Compiler support wasn't great Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 25. What it means Modern C++? New standards Not just the standards . . . and then (almost full) stop Compiler support wasn't great nor full Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 26. What it means Modern C++? New standards Not just the standards . . . and then (almost full) stop Compiler support wasn't great nor full Other languages gained momentum (Java - started '95, C# - started '02) Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 27. What it means Modern C++? New standards Not just the standards . . . and then (almost full) stop Compiler support wasn't great nor full Other languages gained momentum (Java - started '95, C# - started '02) Vague promises for having C++0x Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 28. What it means Modern C++? New standards Not just the standards . . . and then (almost full) stop Compiler support wasn't great nor full Other languages gained momentum (Java - started '95, C# - started '02) Vague promises for having C++0x Nothing much meanwhile Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 29. What it means Modern C++? New standards Not just the standards . . . and then (almost full) stop Compiler support wasn't great nor full Other languages gained momentum (Java - started '95, C# - started '02) Vague promises for having C++0x Nothing much meanwhile (TR1?) Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 30. What it means Modern C++? New standards Not just the standards But then it started again! Standard Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 31. What it means Modern C++? New standards Not just the standards But then it started again! Standard C++11 Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 32. What it means Modern C++? New standards Not just the standards But then it started again! Standard C++11 (C++0b?) Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 33. What it means Modern C++? New standards Not just the standards But then it started again! Standard C++11 (C++0b?) C++14 Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 34. What it means Modern C++? New standards Not just the standards But then it started again! Standard C++11 (C++0b?) C++14 C++17 Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 35. What it means Modern C++? New standards Not just the standards But then it started again! Standard C++11 (C++0b?) C++14 C++17 Many TSes Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 36. What it means Modern C++? New standards Not just the standards But then it started again! Standard C++11 (C++0b?) C++14 C++17 Many TSes Compiler support Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 37. What it means Modern C++? New standards Not just the standards But then it started again! Standard C++11 (C++0b?) C++14 C++17 Many TSes Compiler support Even a completly new and shiny compiler, Clang (LLVM based) Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 38. What it means Modern C++? New standards Not just the standards But then it started again! Standard C++11 (C++0b?) C++14 C++17 Many TSes Compiler support Even a completly new and shiny compiler, Clang (LLVM based) Tool support Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 39. What it means Modern C++? New standards Not just the standards But then it started again! Standard C++11 (C++0b?) C++14 C++17 Many TSes Compiler support Even a completly new and shiny compiler, Clang (LLVM based) Tool support IDEs, static and dynamic analyzers, etc. Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 41. What it means Modern C++? New standards Not just the standards Outline 1 What it means Modern C++? New standards Not just the standards Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 42. What it means Modern C++? New standards Not just the standards Not only 'what', it's also about the 'how' C++ Core Guidelines Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 43. What it means Modern C++? New standards Not just the standards Not only 'what', it's also about the 'how' C++ Core Guidelines http://isocpp.github.io/CppCoreGuidelines/ CppCoreGuidelines Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 44. What it means Modern C++? New standards Not just the standards Not only 'what', it's also about the 'how' C++ Core Guidelines http://isocpp.github.io/CppCoreGuidelines/ CppCoreGuidelines Scott Meyers' Eective C++ series Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 45. What it means Modern C++? New standards Not just the standards Not only 'what', it's also about the 'how' C++ Core Guidelines http://isocpp.github.io/CppCoreGuidelines/ CppCoreGuidelines Scott Meyers' Eective C++ series Eective C++ (3 rd ed.), More Eective C++, Eective STL, Eective Modern C++ Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 46. What it means Modern C++? New standards Not just the standards Not only 'what', it's also about the 'how' C++ Core Guidelines http://isocpp.github.io/CppCoreGuidelines/ CppCoreGuidelines Scott Meyers' Eective C++ series Eective C++ (3 rd ed.), More Eective C++, Eective STL, Eective Modern C++ More. . . Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 47. What it means Modern C++? New standards Not just the standards Not only 'what', it's also about the 'how' C++ Core Guidelines http://isocpp.github.io/CppCoreGuidelines/ CppCoreGuidelines Scott Meyers' Eective C++ series Eective C++ (3 rd ed.), More Eective C++, Eective STL, Eective Modern C++ More. . . Generally: the common wisdom the C++ developer community collected over the years Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 48. Wasn't C++ dead years ago? Aren't managed languages all what we need? Outline Part II Modern C++ - Why? 2 Wasn't C++ dead years ago? 3 Aren't managed languages all what we need? Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 49. Wasn't C++ dead years ago? Aren't managed languages all what we need? Outline 2 Wasn't C++ dead years ago? 3 Aren't managed languages all what we need? Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 50. Wasn't C++ dead years ago? Aren't managed languages all what we need? The Free Lunch Is Over In '05, Herb Sutter wrote an article titled The Free Lunch Is Over: A Fundamental Turn Toward Concurrency in Software Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 51. Wasn't C++ dead years ago? Aren't managed languages all what we need? The Free Lunch Is Over In '05, Herb Sutter wrote an article titled The Free Lunch Is Over: A Fundamental Turn Toward Concurrency in Software http: //www.gotw.ca/publications/concurrency-ddj.htm Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 52. Wasn't C++ dead years ago? Aren't managed languages all what we need? The Free Lunch Is Over In '05, Herb Sutter wrote an article titled The Free Lunch Is Over: A Fundamental Turn Toward Concurrency in Software http: //www.gotw.ca/publications/concurrency-ddj.htm Key observation was simply looking at the following graph: Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 54. Wasn't C++ dead years ago? Aren't managed languages all what we need? Why C++ No free lunch Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 55. Wasn't C++ dead years ago? Aren't managed languages all what we need? Why C++ No free lunch One conclusion is that concurrency and parallelism became very important to utilize the CPU advancement Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 56. Wasn't C++ dead years ago? Aren't managed languages all what we need? Why C++ No free lunch One conclusion is that concurrency and parallelism became very important to utilize the CPU advancement Another conclusion, as Sutter explained in C++ and Beyond 2011, is that we care again about performance Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 57. Wasn't C++ dead years ago? Aren't managed languages all what we need? Why C++ No free lunch One conclusion is that concurrency and parallelism became very important to utilize the CPU advancement Another conclusion, as Sutter explained in C++ and Beyond 2011, is that we care again about performance Performance per Watt Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 58. Wasn't C++ dead years ago? Aren't managed languages all what we need? Why C++ No free lunch One conclusion is that concurrency and parallelism became very important to utilize the CPU advancement Another conclusion, as Sutter explained in C++ and Beyond 2011, is that we care again about performance Performance per Watt Both mobile and datacenters Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 59. Wasn't C++ dead years ago? Aren't managed languages all what we need? Why C++ No free lunch One conclusion is that concurrency and parallelism became very important to utilize the CPU advancement Another conclusion, as Sutter explained in C++ and Beyond 2011, is that we care again about performance Performance per Watt Both mobile and datacenters Performance per Size Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 60. Wasn't C++ dead years ago? Aren't managed languages all what we need? Why C++ No free lunch One conclusion is that concurrency and parallelism became very important to utilize the CPU advancement Another conclusion, as Sutter explained in C++ and Beyond 2011, is that we care again about performance Performance per Watt Both mobile and datacenters Performance per Size Performace per Cycle Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 61. Wasn't C++ dead years ago? Aren't managed languages all what we need? Why C++ No free lunch One conclusion is that concurrency and parallelism became very important to utilize the CPU advancement Another conclusion, as Sutter explained in C++ and Beyond 2011, is that we care again about performance Performance per Watt Both mobile and datacenters Performance per Size Performace per Cycle Do more with the same for better experience Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 62. Wasn't C++ dead years ago? Aren't managed languages all what we need? Outline 2 Wasn't C++ dead years ago? 3 Aren't managed languages all what we need? Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 63. Wasn't C++ dead years ago? Aren't managed languages all what we need? Aren't managed languages all what we need? Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 64. Wasn't C++ dead years ago? Aren't managed languages all what we need? Aren't managed languages all what we need? Nope Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 65. Wasn't C++ dead years ago? Aren't managed languages all what we need? More seriously Depends on what we are optimizing for Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 66. Wasn't C++ dead years ago? Aren't managed languages all what we need? More seriously Depends on what we are optimizing for The usual trade-o (no, not space/time trade-o) Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 67. Wasn't C++ dead years ago? Aren't managed languages all what we need? More seriously Depends on what we are optimizing for The usual trade-o (no, not space/time trade-o) Developer/development time - Managed Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 68. Wasn't C++ dead years ago? Aren't managed languages all what we need? More seriously Depends on what we are optimizing for The usual trade-o (no, not space/time trade-o) Developer/development time - Managed Performance - Unmanaged Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 69. Wasn't C++ dead years ago? Aren't managed languages all what we need? More seriously Depends on what we are optimizing for The usual trade-o (no, not space/time trade-o) Developer/development time - Managed Performance - Unmanaged (Compatibility is also a big win for C++, but that isn't new) Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 70. Wasn't C++ dead years ago? Aren't managed languages all what we need? More seriously Depends on what we are optimizing for The usual trade-o (no, not space/time trade-o) Developer/development time - Managed Performance - Unmanaged (Compatibility is also a big win for C++, but that isn't new) What it means Managed / Unmanaged? Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 71. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? Outline Part III Modern C++ - What? 4 But C++ is not the right choice anyway 5 Isn't C++ very hard to use? 6 Isn't C++ very unsafe to use? Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 72. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? Outline 4 But C++ is not the right choice anyway 5 Isn't C++ very hard to use? 6 Isn't C++ very unsafe to use? Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 73. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? What are the main pain points you have about C++? Here are (some of) mine:
  • 74. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? What are the main pain points you have about C++? Here are (some of) mine: Usability issues:
  • 75. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? What are the main pain points you have about C++? Here are (some of) mine: Usability issues: Hard-to-spell long template instantiation types
  • 76. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? What are the main pain points you have about C++? Here are (some of) mine: Usability issues: Hard-to-spell long template instantiation types const std::setstd::mapstd::string, std::pair int, std::vectordouble::iterator::const_iterator Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 77. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? What are the main pain points you have about C++? Here are (some of) mine: Usability issues: Hard-to-spell long template instantiation types const std::setstd::mapstd::string, std::pair int, std::vectordouble::iterator::const_iterator Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 78. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? What are the main pain points you have about C++? Here are (some of) mine: Usability issues: Hard-to-spell long template instantiation types const std::setstd::mapstd::string, std::pair int, std::vectordouble::iterator::const_iterator Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 79. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? What are the main pain points you have about C++? Here are (some of) mine: Usability issues: Hard-to-spell long template instantiation types const std::setstd::mapstd::string, std::pair int, std::vectordouble::iterator::const_iterator Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 80. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? What are the main pain points you have about C++? Here are (some of) mine: Usability issues: Hard-to-spell long template instantiation types const std::setstd::mapstd::string, std::pair int, std::vectordouble::iterator::const_iterator Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 81. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? What are the main pain points you have about C++? Here are (some of) mine: Usability issues: Hard-to-spell long template instantiation types const std::setstd::mapstd::string, std::pair int, std::vectordouble::iterator::const_iterator Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 82. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? What are the main pain points you have about C++? Here are (some of) mine: Usability issues: Hard-to-spell long template instantiation types Writing explicit loops Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 83. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? What are the main pain points you have about C++? Here are (some of) mine: Usability issues: Hard-to-spell long template instantiation types Writing explicit loops Example: 01-ExplicitLoops.cpp Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 84. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? What are the main pain points you have about C++? Here are (some of) mine: Usability issues: Hard-to-spell long template instantiation types Writing explicit loops Example: 01-ExplicitLoops.cpp Inconsistency (e.g. initializing struct vs. class vs. array vs. container) Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 85. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? What are the main pain points you have about C++? Here are (some of) mine: Usability issues: Hard-to-spell long template instantiation types Writing explicit loops Example: 01-ExplicitLoops.cpp Inconsistency (e.g. initializing struct vs. class vs. array vs. container) Example: 02-InitDierences.cpp (rst part) Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 86. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? What are the main pain points you have about C++? Here are (some of) mine: Usability issues: Hard-to-spell long template instantiation types Writing explicit loops Example: 01-ExplicitLoops.cpp Inconsistency (e.g. initializing struct vs. class vs. array vs. container) Example: 02-InitDierences.cpp (rst part) Safety issues: Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 87. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? What are the main pain points you have about C++? Here are (some of) mine: Usability issues: Hard-to-spell long template instantiation types Writing explicit loops Example: 01-ExplicitLoops.cpp Inconsistency (e.g. initializing struct vs. class vs. array vs. container) Example: 02-InitDierences.cpp (rst part) Safety issues: Pointers are dangerous Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 88. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? What are the main pain points you have about C++? Here are (some of) mine: Usability issues: Hard-to-spell long template instantiation types Writing explicit loops Example: 01-ExplicitLoops.cpp Inconsistency (e.g. initializing struct vs. class vs. array vs. container) Example: 02-InitDierences.cpp (rst part) Safety issues: Pointers are dangerous Explicit memory handling (no garbage collector) Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 89. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? What are the main pain points you have about C++? Here are (some of) mine: Usability issues: Hard-to-spell long template instantiation types Writing explicit loops Example: 01-ExplicitLoops.cpp Inconsistency (e.g. initializing struct vs. class vs. array vs. container) Example: 02-InitDierences.cpp (rst part) Safety issues: Pointers are dangerous Explicit memory handling (no garbage collector) Implicit conversions Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 90. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? Outline 4 But C++ is not the right choice anyway 5 Isn't C++ very hard to use? 6 Isn't C++ very unsafe to use? Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 91. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? Easier-to-use added features We'll present here a few features of modern C++ Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 92. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? Easier-to-use added features We'll present here a few features of modern C++ Most of them made the language easier to use Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 93. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? Easier-to-use added features We'll present here a few features of modern C++ Most of them made the language easier to use Usually they improve safety too Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 94. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? Easier-to-use added features We'll present here a few features of modern C++ Most of them made the language easier to use Usually they improve safety too Sometimes they also improve performance (but in no case hurt performance) Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 95. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? auto auto Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 96. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? auto auto AAA - Almost Always Auto Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 97. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? auto auto AAA - Almost Always Auto (Improved in C++17 with copy elision guarantee and not deducing initializer-list) Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 98. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? auto auto AAA - Almost Always Auto (Improved in C++17 with copy elision guarantee and not deducing initializer-list) It's also about performance Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 99. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? auto auto AAA - Almost Always Auto (Improved in C++17 with copy elision guarantee and not deducing initializer-list) It's also about performance Prevents hidden implicit copy (Eective Modern C++, Scott Meyers) Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 100. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? auto auto AAA - Almost Always Auto (Improved in C++17 with copy elision guarantee and not deducing initializer-list) It's also about performance Prevents hidden implicit copy (Eective Modern C++, Scott Meyers) std::mapstd::string, int m; // Fill with data ... for (auto i = m.begin(); i != m.end(); ++i) { const std::pairstd::string, int entry = *i; // Work with entry } Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 101. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? auto auto AAA - Almost Always Auto (Improved in C++17 with copy elision guarantee and not deducing initializer-list) It's also about performance Prevents hidden implicit copy (Eective Modern C++, Scott Meyers) It's actually also about safety Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 102. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? auto auto AAA - Almost Always Auto (Improved in C++17 with copy elision guarantee and not deducing initializer-list) It's also about performance Prevents hidden implicit copy (Eective Modern C++, Scott Meyers) It's actually also about safety Better maintainability, esp. with refactoring; better generic code Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 103. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? auto auto AAA - Almost Always Auto (Improved in C++17 with copy elision guarantee and not deducing initializer-list) It's also about performance Prevents hidden implicit copy (Eective Modern C++, Scott Meyers) It's actually also about safety Better maintainability, esp. with refactoring; better generic code (We'll see it in use in the following code examples) Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 104. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? Better loops Range-based for loops Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 105. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? Better loops Range-based for loops Example: 01-ExplicitLoops-RangeBased.cpp Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 106. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? Better loops Range-based for loops Example: 01-ExplicitLoops-RangeBased.cpp Algorithms are better (loops with name and explicit intention) - but harder to use! Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 107. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? Better loops Range-based for loops Example: 01-ExplicitLoops-RangeBased.cpp Algorithms are better (loops with name and explicit intention) - but harder to use! Example: 01-ExplicitLoops-Algorithms.cpp Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 108. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? Better loops Range-based for loops Example: 01-ExplicitLoops-RangeBased.cpp Algorithms are better (loops with name and explicit intention) - but harder to use! Example: 01-ExplicitLoops-Algorithms.cpp Lambda functions - make algorithms usable Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 109. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? Better loops Range-based for loops Example: 01-ExplicitLoops-RangeBased.cpp Algorithms are better (loops with name and explicit intention) - but harder to use! Example: 01-ExplicitLoops-Algorithms.cpp Lambda functions - make algorithms usable Example: 01-ExplicitLoops-Lambdas.cpp Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 110. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? Better initialization Brace initializers (e.g. no discrimination against init of member structs and arrays; init of containers) Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 111. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? Better initialization Brace initializers (e.g. no discrimination against init of member structs and arrays; init of containers) In-class initializers Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 112. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? Better initialization Brace initializers (e.g. no discrimination against init of member structs and arrays; init of containers) In-class initializers Example: 02-InitDierences.cpp (second part) Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 113. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? Better information passing std::tuple Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 114. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? Better information passing std::tuple (C# is catching up with C#7) Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 115. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? Better information passing std::tuple (C# is catching up with C#7) Further expanded by structured binding in C++17 Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 116. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? Outline 4 But C++ is not the right choice anyway 5 Isn't C++ very hard to use? 6 Isn't C++ very unsafe to use? Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 117. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? One safety mechanism to rule them all RAII Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 118. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? One safety mechanism to rule them all RAII Solves both resource safety issues and exception safety issues (e.g. auto reset a ag) Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 119. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? One safety mechanism to rule them all RAII Solves both resource safety issues and exception safety issues (e.g. auto reset a ag) Smart pointers Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 120. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? One safety mechanism to rule them all RAII Solves both resource safety issues and exception safety issues (e.g. auto reset a ag) Smart pointers Example: SmartPointers.sln Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 121. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? One safety mechanism to rule them all RAII Solves both resource safety issues and exception safety issues (e.g. auto reset a ag) Smart pointers Example: SmartPointers.sln Example: RAII Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 122. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? One safety mechanism to rule them all RAII Solves both resource safety issues and exception safety issues (e.g. auto reset a ag) Smart pointers Example: SmartPointers.sln Example: RAII More RAII tools (STL, fstream, lock_guard) Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 123. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? One safety mechanism to rule them all RAII Solves both resource safety issues and exception safety issues (e.g. auto reset a ag) Smart pointers Example: SmartPointers.sln Example: RAII More RAII tools (STL, fstream, lock_guard) Scope guard Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 124. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? One safety mechanism to rule them all RAII Solves both resource safety issues and exception safety issues (e.g. auto reset a ag) Smart pointers Example: SmartPointers.sln Example: RAII More RAII tools (STL, fstream, lock_guard) Scope guard Example: ScopeGuard Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 125. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? Another interesting safety mechanism Mars land vehicle story Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 126. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? Another interesting safety mechanism Mars land vehicle story https://en.wikipedia.org/wiki/Mars_Climate_Orbiter Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 127. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? Another interesting safety mechanism Mars land vehicle story https://en.wikipedia.org/wiki/Mars_Climate_Orbiter UDLs Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 128. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? Another interesting safety mechanism Mars land vehicle story https://en.wikipedia.org/wiki/Mars_Climate_Orbiter UDLs Bjarne Stroustrup's talk, slides 18-23 Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 129. But C++ is not the right choice anyway Isn't C++ very hard to use? Isn't C++ very unsafe to use? Another interesting safety mechanism Mars land vehicle story https://en.wikipedia.org/wiki/Mars_Climate_Orbiter UDLs Bjarne Stroustrup's talk, slides 18-23 Example: UDLs Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 130. Outline Part IV Summary Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 131. Summary We discussed: Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 132. Summary We discussed: Why Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 133. Summary We discussed: Why (A bit of) What Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 134. Outline Part V References Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 135. References C++ Today: The Beast Is Back; Ga²per Aºman, Jon Kalb; http: //www.oreilly.com/programming/free/c++-today.csp Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 136. References C++ Today: The Beast Is Back; Ga²per Aºman, Jon Kalb; http: //www.oreilly.com/programming/free/c++-today.csp Elements of Modern C++ Style; Herb Sutter; https://herbsutter.com/elements-of-modern-c-style/ Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 137. References C++ Today: The Beast Is Back; Ga²per Aºman, Jon Kalb; http: //www.oreilly.com/programming/free/c++-today.csp Elements of Modern C++ Style; Herb Sutter; https://herbsutter.com/elements-of-modern-c-style/ C++ Super-FAQ; https://isocpp.org/faq Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 138. References C++ Today: The Beast Is Back; Ga²per Aºman, Jon Kalb; http: //www.oreilly.com/programming/free/c++-today.csp Elements of Modern C++ Style; Herb Sutter; https://herbsutter.com/elements-of-modern-c-style/ C++ Super-FAQ; https://isocpp.org/faq C++ reference; http://cppreference.com Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 139. References C++ Today: The Beast Is Back; Ga²per Aºman, Jon Kalb; http: //www.oreilly.com/programming/free/c++-today.csp Elements of Modern C++ Style; Herb Sutter; https://herbsutter.com/elements-of-modern-c-style/ C++ Super-FAQ; https://isocpp.org/faq C++ reference; http://cppreference.com C++ Core Guidelines; http://isocpp.github.io/ CppCoreGuidelines/CppCoreGuidelines Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 140. References C++ Today: The Beast Is Back; Ga²per Aºman, Jon Kalb; http: //www.oreilly.com/programming/free/c++-today.csp Elements of Modern C++ Style; Herb Sutter; https://herbsutter.com/elements-of-modern-c-style/ C++ Super-FAQ; https://isocpp.org/faq C++ reference; http://cppreference.com C++ Core Guidelines; http://isocpp.github.io/ CppCoreGuidelines/CppCoreGuidelines Ask me for more references, articles, books and videos Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What
  • 141. References C++ Today: The Beast Is Back; Ga²per Aºman, Jon Kalb; http: //www.oreilly.com/programming/free/c++-today.csp Elements of Modern C++ Style; Herb Sutter; https://herbsutter.com/elements-of-modern-c-style/ C++ Super-FAQ; https://isocpp.org/faq C++ reference; http://cppreference.com C++ Core Guidelines; http://isocpp.github.io/ CppCoreGuidelines/CppCoreGuidelines Ask me for more references, articles, books and videos (or just google it) Yehezkel Bernat - YehezkelShB@gmail.com Modern C++ - Why and What