forked from Light-City/CPlusPlusThings
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinitializer.cpp
More file actions
Latest commit
22 lines (18 loc) · 599 Bytes
/
Copy pathinitializer.cpp
File metadata and controls
22 lines (18 loc) · 599 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//
// Created by light on 19-11-3.
//
#include<iostream>
#include<algorithm>
usingnamespacestd;
intmain() {
int i;
intj(); // 0
int *p;
int *q(); // nullptr
// int x1{5.0}; // error:narrowing conversion
// 编译器调用initializer_list私有构造之前,编译器准备好array(array头)与len,传递给该构造,并没有内含这个array,
// 指针指向array,copy只是浅copy.
// 如今所有容器都接受任意数量的值 insert()或assign() max() min()
cout<<max({1,2,3})<<endl; // algorithm里面的max/min
return0;
}