-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcpp20Test.cpp
More file actions
64 lines (55 loc) · 955 Bytes
/
Copy pathcpp20Test.cpp
File metadata and controls
64 lines (55 loc) · 955 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//
// Created by william on 2021/4/1.
//
static_assert(__cplusplus >= 201707);
#include <algorithm>
#include <functional>
#if __has_include(<bit>)
#include <bit>
#endif
#include <cassert>
#include <cmath>
#include <iostream>
#include <map>
#include <memory>
#include <thread>
#include <vector>
#if __cpp_impl_coroutine
#include <coroutine>
#endif
#include <sstream>
#if __has_include(<concepts>)
#include <concepts>
#endif
using namespace std;
void init_20()
{
struct point
{
int x, y;
};
struct line
{
point a, b;
};
point p1 = { .x = 1 };
assert(p1.x == 1);
assert(!p1.y);
point p2{ {}, 2 };
assert(p2.y == 2);
assert(!p2.x);
line l1 = {};
assert(!l1.a.x);
line l3 = { 1, 2, 3, 4 };
assert(l3.b.x == 3);
assert(l3.b.y == 4);
}
void types_20()
{
//#if __cpp_lib_bit_cast
// std::cout << typeid(bit_cast<double>());
//#endif
}
void cpp20Test()
{
}