SlideShare a Scribd company logo
1 of 88
Download to read offline
cyberplus
C++11 & C++14
Nagesh Rao
Managing Director
CyberPlus Infotech Pvt. Ltd.
cyberplus
©2015, CyberPlus Infotech Pvt. Ltd.
cyberplus
C++11/14
Enhancements:
Data Types
cyberplus
Data Types
char (1)
short (2)
int (2,4)
long (4,8)
long long (8)
cyberplus
sizeof
class A {
int x;
B b;
};
s = sizeof(A);
s = sizeof(A::x);
s = sizeof(A::b);
cyberplus
Memory Alignment
size_t alignof(T);
alignas(T)
alignas(alignof(T))
alignas(float) float f;
alignas(long) char buf[100*sizeof(long)];
cyberplus
C++11/14
Enhancements:
Literals
cyberplus
String Literals
C++03:
"Hello" const char[]
L"Hello" const wchar_t[]
C++11:
u8"Hello u20B9" const char[]
u"Hello u20B9" const char16_t[]
U"Hello U000020B9" const char32_t[]
cyberplus
Raw String Literals
R"delimiter(string)delimiter"
R"(Hello)"
R"abc(Hello)abc"
R"abc(Hello"HelloHello)Hello)abc"
u8R"abc(Hello"HelloHello)Hello)abc"
uR"abc(Hello"HelloHello)Hello)abc"
UR"abc(Hello"HelloHello)Hello)abc"
cyberplus
User Defined Literals
126_km
55_m
1600_LY
2000_AD
5_years
12_mon
18.6_cm
36.2_degC
18.2_GB
"Hello"_lowercase
L"Hello"_lowercase
u8"Hello"_lowercase
u"Hello"_lowercase
U"Hello"_lowercase
C++14
0b10000101
0B10000101
24'000'000
3.141'592'653'59
0b1000'0101
12'345'6'789'0
Raw form vs Cooked form
'1' '2' '3' '4'
vs
1234
cyberplus
Integral User Defined Literals
Type operator "" _suffix(unsigned long long x);
Type operator "" _suffix(const char *str, size_t len);
Type operator "" _suffix<'c1','c2','c3'>();
cyberplus
Real User Defined Literals
Type operator "" _suffix(long double x);
Type operator "" _suffix(const char *str, size_t len);
Type operator "" _suffix<'c1','c2','c3'>();
cyberplus
String User Defined Literals
Type operator "" _suffix(const char *str, size_t len);
Type operator "" _suffix(const wchar_t *str, size_t len);
Type operator "" _suffix(const char16_t *str, size_t len);
Type operator "" _suffix(const char32_t *str, size_t len);
Type operator "" _suffix(char c);
Type operator "" _suffix(wchar_t c);
Type operator "" _suffix(char16_t c);
Type operator "" _suffix(char32_t c);
cyberplus
C++14 Standard Suffixes
Suffix Meaning
s A string literal
h Hours
min Minutes
s Seconds
ms Milliseconds
us Microseconds
ns Nanoseconds
cyberplus
Attributes
Device dev0;
Device [[a1]] dev1 [[a2]];
Device dev2 [[a3, a4]];
Device dev3 [[a5(i,j)]];
Device dev4 [[NS::a6]];
[[a7]] while (!ready) { /* ... */ }
➢
Help convey information to compilers and tools
➢
Replacement for #pragma
➢
Usually present after named entities
➢
Usually present before unnamed entitites
cyberplus
Attributes
C++14
[[deprecated]] void f();
[[deprecated("Use g() instead.")]] void f();
cyberplus
C++11/14
Enhancements:
Loops
cyberplus
Range Based Loops
for (int i=0; i<n; i++) { x[i]; }
for (int i: x) { i; }
for (int &i: x) { i; }
for (vector<int>::iterator i=v.begin(); i!=v.end(); i++) { *i; }
for (int i: v) { i; }
for (int &i: v) { i; }
cyberplus
C++11/14
Enhancements:
Constants
cyberplus
constexpr data members
const
Runtime constants
const double PI=3.14;
const double PI_2=PI/2;
constexpr
Compile time constants
constexpr double PI=3.14;
constexpr double PI_2=PI/2;
Pre-processor Compiler Runtime
#define constexpr const
cyberplus
constexpr functions
Limitations in C++11:
• Non-void return type
• No variable or data type definition
• Can contain non-executable statements and static_asserts
• Single executable statement: return
• Arguments (if any) are compile-time constants
• All constexpr functions are also treated as const member functions if non-static
int x[f()];
constexpr int f() { return 100; }
cyberplus
constexpr in C++14
Enhancements:
• Almost any statement permitted, including decisions and loops
• Not a non-static const member function automatically
– Can change only objects created within the constant
context
• No goto statement
• No static or thread_local variables
• No local variables without initializers
cyberplus
Static Assertions
assert
Runtime check
static_assert
Compile time check
Pre-processor Compiler Runtime
#error static_assert assert
static_assert(condition, error_message);
static_assert(MAX>100, "MAX is too big!");
template <class T>
class A { static_assert(sizeof(T)>32, "Size too big!"); }
cyberplus
C++11/14
Enhancements:
Enumerations
cyberplus
Enumeration in C++03
Problems:
1. Underlying type and size is platform dependent and non-portable
2. Enumerators expand into the scope of the enumeration
3. Easy conversion to integers makes undesirable possibilities
possible
4. Forward declarations are not possible
cyberplus
Enumeration in C++11
enum class Day {
Sun, Mon, Tue, Wed, Thu, Fri, Sat
};
Problem #1:
Underlying type and size is platform dependent and non-portable
Solution:
Underlying type is int (and can be changed by explicitly specifying),
and is therefore portable
enum class Day : unsigned int {
Sun, Mon, Tue, Wed, Thu, Fri, Sat };
enum Day : unsigned int {
Sun, Mon, Tue, Wed, Thu, Fri, Sat };
cyberplus
Enumeration in C++11
Problem #2:
Enumerators expand into the scope of the enumeration
Solution:
Enumerators are protected by the scope of the enumeration
enum class Day {
Sun, Mon, Tue, Wed, Thu, Fri, Sat };
enum class SolarSystem {
Sun, Earth, Moon };
Day d(Day::Tue);
if (d == Day::Wed) { /* ... */ }
cyberplus
Enumeration in C++11
Problem #3:
Easy conversion to integers makes undesirable possibilities possible
Solution:
Enumerators are not implicitly convertible to other types
enum class Day {
Sun, Mon, Tue, Wed, Thu, Fri, Sat };
enum class SolarSystem {
Sun, Earth, Moon };
if (Day::Sun == SolarSystem::Sun) { /* ... */ }
cyberplus
Enumeration in C++11
Problem #4:
Forward declarations are not possible
Solution:
Forward declarations are possible as the underlying type is known
enum Day; // Wrong! Can't determine underlying type
// without seeing enumerators
enum class Day; // Ok, type is int
enum class Day: char; // Ok, type is char
enum Day: char; // Ok, type is char
cyberplus
C++11/14
Enhancements:
Typedef
cyberplus
C++11 Typedef
Better syntax:
typedef void (*fptr)(int);
using fptr = void (*)(int);
Works with templates too!
template <class T>
using vec2D = vector<vector<T>>;
vec2D<int> x;
vector<vector<int>> x;
cyberplus
C++11/14
Enhancements:
Pointers
cyberplus
NULL Pointers
NULL Pointer in C: (void*)0
NULL Pointer in C++: 0
void print(char *str);
void print(int x);
print(NULL);
NULL Pointer in C++11: nullptr
void print(char *str);
void print(int x);
void print(nullptr_t ptr);
cyberplus
C++11/14
Enhancements:
Smart Pointers
cyberplus
Smart Pointers: auto_ptr
void f()
{
int *i = new int;
// Don't forget to delete
delete i;
}
void f()
{
int *i = new int;
std::auto_ptr<int> p(i);
//Don't have to delete
}
A B
cyberplus
Smart Pointers: auto_ptr
int main()
{
std::auto_ptr<int> p;
p = f(std::auto_ptr<int>(new int));
}
std::auto_ptr<int> f(std::auto_ptr<int> p1)
{
std::auto_ptr<int> p2;
p2 = p1;
return p2;
}
cyberplus
Smart Pointers: auto_ptr
*ptr
ptr->x
ptr.get()
ptr.release()
ptr.reset();
ptr.reset(ptr2);
cyberplus
Smart Pointers: auto_ptr
int *i = new int(3);
std::auto_ptr<int> p1(i);
std::cout << *p1 << endl; // 3
std::cout << p1.get() << endl;// Address of the int
int *j;
j=p1.get();
std::cout << j << endl; // Address of the int
std::cout << p1 << endl; // Address of the int
cyberplus
Smart Pointers: auto_ptr
int *i = new int(3);
std::auto_ptr<int> p1(i);
std::cout << *p1 << endl; // 3
std::cout << p1.get() << endl;// Address of the int
int *j;
j=p1.release();
std::cout << j << endl; // Address of the int
std::cout << p1 << endl; // NULL
delete j; //Deallocates memory
cyberplus
Smart Pointers: auto_ptr
int *i = new int(3);
std::auto_ptr<int> p1(i);
std::cout << *p1 << endl; // 3
std::cout << p1.get() << endl;// Address of the int
p1.reset();
std::cout << p1.get() << endl; // NULL
cyberplus
Smart Pointers: auto_ptr
int *i = new int(3);
std::auto_ptr<int> p1(i);
std::cout << *p1 << endl; // 3
std::cout << p1.get() << endl;// Address of the int
p1.reset(new int(5));
std::cout << p1.get() << endl; // Address of the new int
std::cout << *p1 << endl; // 5
cyberplus
Smart Pointers: auto_ptr
int *i = new int(3);
std::auto_ptr<int> p1(i);
std::cout << *p1 << endl; // 3
std::cout << p1.get() << endl;// Address of the int
std::auto_ptr<int> p2;
p2=p1; // Ownership transferred to p2
std::cout << p1.get() << endl; // NULL
std::cout << p2.get() << endl; // Address of the int
cyberplus
Smart Pointers: unique_ptr
int *i = new int(3);
std::unique_ptr<int> p1(i);
std::cout << *p1 << endl; // 3
std::cout << p1.get() << endl;// Address of the int
std::unique_ptr<int> p2;
p2 = p1; // Error: Copy semantics not supported
p2 = std::move(p1); // Correct: Move semantics
std::cout << p1.get() << endl; // NULL
std::cout << p2.get() << endl; // Address of the int
cyberplus
Smart Pointers: shared_ptr
int *i = new int(3);
std::shared_ptr<int> p1(i);
std::cout << *p1 << endl; // 3
std::cout << p1.get() << endl;// Address of the int
std::shared_ptr<int> p2;
p2 = p1; // Both have ownership
std::cout << p1.get() << endl; // Address of the int
std::cout << p2.get() << endl; // Address of the int
p1.release(); // p2 still owns the raw pointer
p2.release(); // Memory freed
cyberplus
Smart Pointers: weak_ptr
int *i = new int(3);
std::shared_ptr<int> p1(i);
std::cout << *p1 << endl; // 3
std::cout << p1.get() << endl;// Address of the int
std::weak_ptr<int> wp1;
wp1 = p1; // p1 retains ownership
std::cout << p1.get() << endl; // Address of the int
std::cout << wp1.get() << endl; // Address of the int
std::shared_ptr<int> p2 = wp1.lock();
if (p2) {
// p1 and p2 own the raw pointer
}
cyberplus
Smart Pointers
std::shared_ptr<int> ptr(new int(5));
std::shared_ptr<int> ptr = std::make_shared<int>(5);
C++14
std::unique_ptr<int> ptr(new int(5));
std::unique_ptr<int> ptr = std::make_unique<int>(5);
cyberplus
C++11/14
Enhancements:
References
cyberplus
Rvalue References
3
f(Date(20,3,1946));
void f(Date d);
void f(Date &d);
void f(const Date &d) {
d.day=1;
}
void f(Date &&d) {
d.day=1;
}
1
2
4
Temporaries:
d = Date(20,3,1946);
f(Date(20,3,1946));
d = f();
Date f() {
return Date(20,3,1946);
}
Use cases:
1. Variables are treated as constants
2. Constants are treated as variables
cyberplus
C++11/14
Enhancements:
Type Inference
cyberplus
Type Inference
int x=10;
auto y=10;
auto d = getCurrentDate();
int x[10];
for (auto i: x) { i; }
for (auto i=v.begin(); i!=v.end(); i++)
for (auto i: v) { i; }
for (auto &i: v) { i; }
for (auto &&i: v) { i; }
cyberplus
Type Inference
auto a=10;
auto b=a;
decltype(a) c;
decltype(a) d=a;
decltype((a)) e=a;
auto &f = a;
auto &&h=a;
decltype(10) g;
cyberplus
C++11/14
Enhancements:
Functions
cyberplus
Improved Function Syntax
class A {
int add(int x, int y);
};
int A::add(int x, int y) {
return x+y;
}
class A {
auto add(int x, int y) -> int;
};
auto A::add(int x, int y) -> int {
return x+y;
}
C++14 (Needs to be defined before use)
auto A::add(int x, int y) {
return x+y;
}
cyberplus
Improved Function Syntax
template <class A, class B>
decltype(a+b) add(A &a, B &b) { return a+b; }
template <class A, class B>
auto add(A &a, B &b) -> decltype(a+b){ return a+b; }
cyberplus
Lambda Expressions
Syntax:
[capture] (parameters) -> return_type {function_body}
[](int x, int y) -> int { return x+y; }
int (*funcptr)(int,int);
funcptr = [](int x, int y) -> int { return x+y; };
std::cout << funcptr(2,3) << endl;
auto func = [](int x, int y) -> int { return x+y; };
std::cout << func(2,3) << endl;
cyberplus
Lambda Expressions
To print all odd numbers from a vector:
std::vector<int> v = {1,6,7};
std::for_each(begin(v), end(v),
[](int x){if (x%2==1) std::cout<<x<<endl; } );
cyberplus
Lambda Expressions
To print all odd numbers greater than 'n' from a vector:
std::vector<int> v = {1,6,7};
int n=5;
std::for_each(begin(v), end(v),
[n](int x){if (x%2==1 && x>n) std::cout<<x<<endl; } );
cyberplus
Lambda Expressions
To find the sum of all odd numbers in a vector:
std::vector<int> v = {1,6,7};
int sum=0;
std::for_each(begin(v), end(v),
[&sum](int x){if (x%2==1) sum+=x; } );
cyberplus
Lambda Expressions
To find the sum of all odd numbers and print all odd numbers greater than 'n':
std::vector<int> v = {1,6,7};
int sum=0;
int n=5;
std::for_each(begin(v), end(v),
[n,&sum](int x){
if (x%2==1) {
sum+=x;
if (x>n) std::cout << x << endl;
}
} );
std::cout << sum << endl;
cyberplus
Summary of Captures
Capture Meaning
[] No access to other variables
[a,b,c] Read-only access to specified variables only
[&a,&b] Read-write access to specified variables only
[a,&b,&c,
d]
Read-only access to a and d; read-write access to b
and c
[&] Read-write access to all variables
[=] Read-only access to all variables
[&,a,b,c] Read-write access to all variables; read-only access
to specified variables
[=,&a,&b] Read-only access to all variables; read-write access
to specified variables
cyberplus
Lambda Expressions
auto fptr = [](int x){ return 2*x; };
std::function<int(int)> fptr = [](int x){ return 2*x; };
int (*fptr)(int) = [](int x){ return 2*x; };
std::cout << fptr(2) << endl;
C++14
auto func = [](auto x, auto y) { return x+y; };
cyberplus
Defaulted/Deleted Functions
class A {
public:
A() = default;
A(const A& a) = delete;
A& operator = (const A& a) = delete;
};
cyberplus
Defaulted/Deleted Functions
class A {
public:
void f(long x);
void f(int x) = delete;
};
class A {
public:
void f(long x);
template <class T>
void f(T x) = delete;
};
cyberplus
Explicit Conversions
class Pointer {
public:
operator bool ();
};
if (ptr) ...
void area(double side);
area(ptr);
class Pointer {
public:
explicit operator bool ();
};
if (ptr) ...
void area(double side);
area(ptr);
cyberplus
C++11/14
Enhancements:
Constructors
cyberplus
Move Constructors
Copy semantics:
A a1 = a2;
A::A(const A& a) {
//...
}
a1 = a2;
A& A::operator =(const A& a) {
//...
}
Move semantics:
A a1 = a2;
A::A(A&& a) {
//...
}
a1 = a2;
A& A::operator =(A&& a) {
//...
}
a1 = std::move(a2);
cyberplus
Constructor Delegation
class Counter
{
int count;
public:
Counter() {
setCount(0);
}
Counter(int count) {
setCount(count);
}
void setCount(int count) {
this.count = count;
}
};
class Counter
{
int count;
public:
Counter(): Counter(0) {
}
Counter(int count) {
setCount(count);
}
void setCount(int count) {
this.count = count;
}
};
cyberplus
Data Member Initialization
class Counter
{
int count=0;
public:
Counter() {
}
Counter(int count) {
this->count = count;
}
};
cyberplus
Initializer Lists
struct Employee {
int id;
std::string name;
};
Employee e1 = {20, “Ram”};
class Point {
int x,y;
};
Point p1 = {2,3};
cyberplus
Initializer Lists
class Point {
int x,y;
std::vector<int> values;
public:
Point(std::initializer_list<int> l): values(l) {
x = values[0];
y = values[1];
}
};
Point p1 = {2,3};
cyberplus
Initializer Lists
class Point {
int x,y;
public:
Point(int x, int y) {
this->x = x;
this->y = y;
// Anything else can go here
}
};
Point p1 = {2,3};
cyberplus
Initializer Lists
Point p = {2,3};
Point p{2,3};
Point *p = new Point{2,3};
Point getPoint(int i) {
return Point{x[i], y[i]};
}
Point getPoint(int i) {
return {x[i], y[i]};
}
Point(int x, int y): x{x}, y{y} {
}
cyberplus
Initializer Lists
class Point {
int x,y;
std::vector<int> values;
public:
void setPoint(std::initializer_list<int> l) {
std::initializer_list<int>::iterator i;
i = l.begin();
x = *i++;
y = *i;
}
};
Point p;
p.setPoint({2,3});
cyberplus
Initializer Lists
class Point {
int x,y;
public:
Point getClosestPoint() {
int x,y;
//...
return {x,y};
}
};
cyberplus
C++11/14
Enhancements:
Inheritance
cyberplus
class A
{
public:
virtual void f1() { }
virtual void f2() { }
virtual void f3() final { }
};
class B: public A
{
public:
void f1() { } // Ok: Overrides
void f2(int x) { } // Ok: Does not override
void f2(double x) override { } // Error, does not override
void f3() { } // Error: cannot override
};
Note: These apply only to virtual functions
override & final
cyberplus
final Classes
class A final
{
//...
};
class B: public A // Error: Cannot derive from final base class
{
//...
};
cyberplus
Base Class Constructors
class A {
int x;
public:
A(int x): x{x} {}
};
class B: public A {
public:
B(int x): A{x} {}
};
class A {
int x;
public:
A(int x): x{x} {}
};
class B: public A {
public:
using A::A;
};
Limitations:
1. All constructors are inherited
2. Derived class cannot have constructors with same signature as base class
3. Multiple base classes cannot have constructors with the same signature
cyberplus
C++11/14
Enhancements:
Templates
cyberplus
C++03:
std::vector<std::vector<int>> v;
std::vector<std::vector<int> > v;
C++11:
std::vector<std::vector<int>> v;
C++11:
std::vector<std::vector<(3>1)>> v;
“>>” in Templates
cyberplus
Class declaration:
class A;
Template class declaration:
template class A<int>; // Instantiates
External template class declaration:
extern template class A<int>; // Does not instantiate
extern Templates
cyberplus
Variadic Templates
template<class T1, class T2>
void f(T1 x, T2 y);
template<class... T>
void f(T... x);
template<class T1, class T2, class... T>
void f(T1 x, T2 y, T... args);
cyberplus
Variadic Templates
template<class T>
void f(T x)
{
//Action on x
}
template<class T, class... Args>
void f(T x, Args... args)
{
f(x);
f(args...);
}
sizeof...(Args)
cyberplus
Tuples
template<class... T> class std::tuple;
std::tuple<int, float> t1; // Default constructor
std::tuple(char, double> t2('a', 6.5);
t1=t2; //Same size; convertible
auto t3 = std::make_tuple(65, 8.3);
cyberplus
Tuples
std::tuple<int, float> t(10,6.5f);
int x = std::get<0>(t);
std::get<0>(t) = 20;
double y;
std::tie(x, y) = t;
std::tie(x, std::ignore) = t;
auto t4 = std::make_tuple(std::ref(x), y);
C++14
std::tuple<int, float> t(10,6.5f);
int x = std::get<int>(t1);
cyberplus
Tuples
typedef std::tuple<int, string> Employee;
Employee e1(1,"Ram");
Employee e2(2,"Shyam");
std::tuple_size<Employee>::value
std::tuple_element<1,Employee>::type
cyberplus
Unordered Associative
Containers
C++03 C++11 Addition
set unordered_set
multiset unordered_multiset
map unordered_map
multimap unordered_multimap
SORTING HASHING
C++14 allows heterogeneous lookup in associative containers
This requires “<” overload between the participating types, though
cyberplus
Variable Templates
C++14
template<class T> constexpr T pi = T(3.14);
template<> constexpr const char *pi<const char*> = "Pi";
cout << toDegrees(pi<double>/2);
cout << string(pi);
cyberplus
Thank you!
CyberPlus Infotech Pvt. Ltd.
32/5, 8th
Main, 11th
Cross,
Malleswaram, Bangalore – 560 003.
Website: www.cyberplusit.com
Email: info@cyberplusit.com
Blog: www.cyberplusindia.com/blog
Facebook Fan Page: www.facebook.com/cyberplusindia

More Related Content

What's hot

MANAGING INPUT AND OUTPUT OPERATIONS IN C MRS.SOWMYA JYOTHI.pdf
MANAGING INPUT AND OUTPUT OPERATIONS IN C    MRS.SOWMYA JYOTHI.pdfMANAGING INPUT AND OUTPUT OPERATIONS IN C    MRS.SOWMYA JYOTHI.pdf
MANAGING INPUT AND OUTPUT OPERATIONS IN C MRS.SOWMYA JYOTHI.pdfSowmyaJyothi3
 
Presentation on C++ Programming Language
Presentation on C++ Programming LanguagePresentation on C++ Programming Language
Presentation on C++ Programming Languagesatvirsandhu9
 
16717 functions in C++
16717 functions in C++16717 functions in C++
16717 functions in C++LPU
 
C++ Programming.pdf
C++ Programming.pdfC++ Programming.pdf
C++ Programming.pdfMrRSmey
 
Programming in C Presentation upto FILE
Programming in C Presentation upto FILEProgramming in C Presentation upto FILE
Programming in C Presentation upto FILEDipta Saha
 
OOP in C++
OOP in C++OOP in C++
OOP in C++ppd1961
 
Operator overloading and type conversions
Operator overloading and type conversionsOperator overloading and type conversions
Operator overloading and type conversionsAmogh Kalyanshetti
 
Programming Global variable
Programming Global variableProgramming Global variable
Programming Global variableimtiazalijoono
 
Function in c language(defination and declaration)
Function in c language(defination and declaration)Function in c language(defination and declaration)
Function in c language(defination and declaration)VC Infotech
 
class and objects
class and objectsclass and objects
class and objectsPayel Guria
 

What's hot (20)

MANAGING INPUT AND OUTPUT OPERATIONS IN C MRS.SOWMYA JYOTHI.pdf
MANAGING INPUT AND OUTPUT OPERATIONS IN C    MRS.SOWMYA JYOTHI.pdfMANAGING INPUT AND OUTPUT OPERATIONS IN C    MRS.SOWMYA JYOTHI.pdf
MANAGING INPUT AND OUTPUT OPERATIONS IN C MRS.SOWMYA JYOTHI.pdf
 
Presentation on C++ Programming Language
Presentation on C++ Programming LanguagePresentation on C++ Programming Language
Presentation on C++ Programming Language
 
16717 functions in C++
16717 functions in C++16717 functions in C++
16717 functions in C++
 
C++ Programming
C++ ProgrammingC++ Programming
C++ Programming
 
C++ Programming.pdf
C++ Programming.pdfC++ Programming.pdf
C++ Programming.pdf
 
C++ programming function
C++ programming functionC++ programming function
C++ programming function
 
Programming in C Presentation upto FILE
Programming in C Presentation upto FILEProgramming in C Presentation upto FILE
Programming in C Presentation upto FILE
 
Modular programming
Modular programmingModular programming
Modular programming
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
 
Function overloading
Function overloadingFunction overloading
Function overloading
 
Functions In C
Functions In CFunctions In C
Functions In C
 
OOP in C++
OOP in C++OOP in C++
OOP in C++
 
Operator overloading and type conversions
Operator overloading and type conversionsOperator overloading and type conversions
Operator overloading and type conversions
 
Programming Global variable
Programming Global variableProgramming Global variable
Programming Global variable
 
Operators
OperatorsOperators
Operators
 
GCC compiler
GCC compilerGCC compiler
GCC compiler
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
 
Function in c language(defination and declaration)
Function in c language(defination and declaration)Function in c language(defination and declaration)
Function in c language(defination and declaration)
 
class and objects
class and objectsclass and objects
class and objects
 
What Can Compilers Do for Us?
What Can Compilers Do for Us?What Can Compilers Do for Us?
What Can Compilers Do for Us?
 

Viewers also liked

Fun with Lambdas: C++14 Style (part 2)
Fun with Lambdas: C++14 Style (part 2)Fun with Lambdas: C++14 Style (part 2)
Fun with Lambdas: C++14 Style (part 2)Sumant Tambe
 
C++11 Idioms @ Silicon Valley Code Camp 2012
C++11 Idioms @ Silicon Valley Code Camp 2012 C++11 Idioms @ Silicon Valley Code Camp 2012
C++11 Idioms @ Silicon Valley Code Camp 2012 Sumant Tambe
 
C++ Generators and Property-based Testing
C++ Generators and Property-based TestingC++ Generators and Property-based Testing
C++ Generators and Property-based TestingSumant Tambe
 
Fun with Lambdas: C++14 Style (part 1)
Fun with Lambdas: C++14 Style (part 1)Fun with Lambdas: C++14 Style (part 1)
Fun with Lambdas: C++14 Style (part 1)Sumant Tambe
 
Introduction au lock-free programming avec std::atomics
Introduction au lock-free programming avec std::atomicsIntroduction au lock-free programming avec std::atomics
Introduction au lock-free programming avec std::atomicsAurélien Regat-Barrel
 
Les fonctions lambdas en C++11 et C++14
Les fonctions lambdas en C++11 et C++14Les fonctions lambdas en C++11 et C++14
Les fonctions lambdas en C++11 et C++14Aurélien Regat-Barrel
 
What's New in C++ 11/14?
What's New in C++ 11/14?What's New in C++ 11/14?
What's New in C++ 11/14?Dina Goldshtein
 
C++11: Rvalue References, Move Semantics, Perfect Forwarding
C++11: Rvalue References, Move Semantics, Perfect ForwardingC++11: Rvalue References, Move Semantics, Perfect Forwarding
C++11: Rvalue References, Move Semantics, Perfect ForwardingFrancesco Casalegno
 
C++17 introduction - Meetup @EtixLabs
C++17 introduction - Meetup @EtixLabsC++17 introduction - Meetup @EtixLabs
C++17 introduction - Meetup @EtixLabsStephane Gleizes
 
Web I - 05 - HTTP Protocol
Web I - 05 - HTTP ProtocolWeb I - 05 - HTTP Protocol
Web I - 05 - HTTP ProtocolRandy Connolly
 
C++11 concurrency
C++11 concurrencyC++11 concurrency
C++11 concurrencyxu liwei
 
"Http protocol and other stuff" by Bipin Upadhyay
"Http protocol and other stuff" by Bipin Upadhyay"Http protocol and other stuff" by Bipin Upadhyay
"Http protocol and other stuff" by Bipin UpadhyayBipin Upadhyay
 
HTTP Protocol Basic
HTTP Protocol BasicHTTP Protocol Basic
HTTP Protocol BasicChuong Mai
 

Viewers also liked (20)

C++11
C++11C++11
C++11
 
Fun with Lambdas: C++14 Style (part 2)
Fun with Lambdas: C++14 Style (part 2)Fun with Lambdas: C++14 Style (part 2)
Fun with Lambdas: C++14 Style (part 2)
 
What's New in C++ 11?
What's New in C++ 11?What's New in C++ 11?
What's New in C++ 11?
 
C++14 Overview
C++14 OverviewC++14 Overview
C++14 Overview
 
C++11 Idioms @ Silicon Valley Code Camp 2012
C++11 Idioms @ Silicon Valley Code Camp 2012 C++11 Idioms @ Silicon Valley Code Camp 2012
C++11 Idioms @ Silicon Valley Code Camp 2012
 
C++ Generators and Property-based Testing
C++ Generators and Property-based TestingC++ Generators and Property-based Testing
C++ Generators and Property-based Testing
 
Fun with Lambdas: C++14 Style (part 1)
Fun with Lambdas: C++14 Style (part 1)Fun with Lambdas: C++14 Style (part 1)
Fun with Lambdas: C++14 Style (part 1)
 
Introduction au lock-free programming avec std::atomics
Introduction au lock-free programming avec std::atomicsIntroduction au lock-free programming avec std::atomics
Introduction au lock-free programming avec std::atomics
 
Les fonctions lambdas en C++11 et C++14
Les fonctions lambdas en C++11 et C++14Les fonctions lambdas en C++11 et C++14
Les fonctions lambdas en C++11 et C++14
 
What's New in C++ 11/14?
What's New in C++ 11/14?What's New in C++ 11/14?
What's New in C++ 11/14?
 
C++11: Rvalue References, Move Semantics, Perfect Forwarding
C++11: Rvalue References, Move Semantics, Perfect ForwardingC++11: Rvalue References, Move Semantics, Perfect Forwarding
C++11: Rvalue References, Move Semantics, Perfect Forwarding
 
C++17 introduction - Meetup @EtixLabs
C++17 introduction - Meetup @EtixLabsC++17 introduction - Meetup @EtixLabs
C++17 introduction - Meetup @EtixLabs
 
Web I - 05 - HTTP Protocol
Web I - 05 - HTTP ProtocolWeb I - 05 - HTTP Protocol
Web I - 05 - HTTP Protocol
 
TCP/IP
TCP/IPTCP/IP
TCP/IP
 
Bjarne essencegn13
Bjarne essencegn13Bjarne essencegn13
Bjarne essencegn13
 
C++11
C++11C++11
C++11
 
C++11 concurrency
C++11 concurrencyC++11 concurrency
C++11 concurrency
 
C++11
C++11C++11
C++11
 
"Http protocol and other stuff" by Bipin Upadhyay
"Http protocol and other stuff" by Bipin Upadhyay"Http protocol and other stuff" by Bipin Upadhyay
"Http protocol and other stuff" by Bipin Upadhyay
 
HTTP Protocol Basic
HTTP Protocol BasicHTTP Protocol Basic
HTTP Protocol Basic
 

Similar to C++11 & C++14

Similar to C++11 & C++14 (20)

C++_notes.pdf
C++_notes.pdfC++_notes.pdf
C++_notes.pdf
 
C++ lectures all chapters in one slide.pptx
C++ lectures all chapters in one slide.pptxC++ lectures all chapters in one slide.pptx
C++ lectures all chapters in one slide.pptx
 
4Developers 2018: Beyond c++17 (Mateusz Pusz)
4Developers 2018: Beyond c++17 (Mateusz Pusz)4Developers 2018: Beyond c++17 (Mateusz Pusz)
4Developers 2018: Beyond c++17 (Mateusz Pusz)
 
CPP Language Basics - Reference
CPP Language Basics - ReferenceCPP Language Basics - Reference
CPP Language Basics - Reference
 
See through C
See through CSee through C
See through C
 
CP 04.pptx
CP 04.pptxCP 04.pptx
CP 04.pptx
 
Lecture 3 c++
Lecture 3 c++Lecture 3 c++
Lecture 3 c++
 
Pointers in C Language
Pointers in C LanguagePointers in C Language
Pointers in C Language
 
Chapter1.pptx
Chapter1.pptxChapter1.pptx
Chapter1.pptx
 
Lecture2.ppt
Lecture2.pptLecture2.ppt
Lecture2.ppt
 
2 BytesC++ course_2014_c9_ pointers and dynamic arrays
2 BytesC++ course_2014_c9_ pointers and dynamic arrays 2 BytesC++ course_2014_c9_ pointers and dynamic arrays
2 BytesC++ course_2014_c9_ pointers and dynamic arrays
 
Степан Кольцов — Rust — лучше, чем C++
Степан Кольцов — Rust — лучше, чем C++Степан Кольцов — Rust — лучше, чем C++
Степан Кольцов — Rust — лучше, чем C++
 
All I know about rsc.io/c2go
All I know about rsc.io/c2goAll I know about rsc.io/c2go
All I know about rsc.io/c2go
 
Code optimization
Code optimization Code optimization
Code optimization
 
Code optimization
Code optimization Code optimization
Code optimization
 
Module 02 Pointers in C
Module 02 Pointers in CModule 02 Pointers in C
Module 02 Pointers in C
 
Computer Programming- Lecture 7
Computer Programming- Lecture 7Computer Programming- Lecture 7
Computer Programming- Lecture 7
 
CPP Homework Help
CPP Homework HelpCPP Homework Help
CPP Homework Help
 
C++ lab assignment
C++ lab assignmentC++ lab assignment
C++ lab assignment
 
CPP Homework Help
CPP Homework HelpCPP Homework Help
CPP Homework Help
 

Recently uploaded

Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Recently uploaded (20)

Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

C++11 & C++14