17 Star 242 Fork 115

Yj / CPlusPlusThings

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
initializer.cpp 599 Bytes
一键复制 编辑 原始数据 按行查看 历史
light-city 提交于 2020-03-03 09:34 . update
//
// Created by light on 19-11-3.
//
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int i;
int j(); // 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
return 0;
}
C++
1
https://gitee.com/yj404/CPlusPlusThings.git
git@gitee.com:yj404/CPlusPlusThings.git
yj404
CPlusPlusThings
CPlusPlusThings
master

搜索帮助