يحتوي الفيديو على شرح للقاط الاتية
00:00 - Intro
01:12 - Reference
04:36 - Function Return-Type Deduction
05:36 - Improved constexpr Functions
06:48 - consteval Functions
10:07 - Selection Statements with Initializers
12:35 - Initialization of an enum by a value of its underlying type
13:49 - Using Scoped enums
14:37 - Structured Binding
19:00 - Copy Elision
22:27 - Outro
تحميل ملف العرض
23 C++14 17 20 Catch up.pdf (6.9% u)
الأمثلة
#include <iostream>
#include <string>
#include <vector>
// Function Return-Type Deduction
// Generic Programming, C++14
template <typename T, typename U>
auto add(T t, U u) // no need for the suffix return type syntax
{
return t + u;
}
// Binary Literals & Digit Separators
auto number_hex{0x10203040};
auto number_binary{0b0001'0000'0010'0000'0011'0000'0100'0000};
auto pi{3.14159'26535'89793'23846'26433'83279'50288};
constexpr int good(int a) {
auto sum = 0; // OK : local variable in constexpr function
This file has been truncated. show original
#include <iostream>
struct Point {
int x, y;
};
auto add(Point a, Point b) { return Point{a.x + b.x, a.y + b.y}; }
int main() {
//
auto p3{add({1, 2}, {5, 6})};
std::cout << "X = " << p3.x << ", Y = " << p3.y << std::endl;
}
#include <iostream>
#include <vector>
struct Point {
int x, y;
};
auto add(Point a, Point b) { return Point{a.x + b.x, a.y + b.y}; }
auto increment(std::vector<Point>& points) {
for (auto& [x, y] : points) {
x++;
y++;
}
}
int main() {
//
auto [p3_x, p3_y]{add({1, 2}, {5, 6})};
This file has been truncated. show original