Using Uniform Initialization to Construct a vector

#include <iostream>
#include <vector>
using namespace std;
int main()
{
using MyVector = vector<int>;
MyVector vectorA( );
cout << vectorA.size() << " " << vectorA[] << endl;
MyVector vectorB( , );
cout << vectorB.size() << " " << vectorB[] << endl;
MyVector vectorC{ , };
cout << vectorC.size() << " " << vectorC[] << endl;
return ;
}

1.使用Uniform Initialization可以使得初始化比较方便。

2.using的使用也比较陌生

2-2. Initializing Objects with Initializer Lists的更多相关文章

  1. C++11中initializer lists的使用

    Before C++11,there was no easy way to do things like initialize a std::vector or std::map(or a custo ...

  2. Modern C++ CHAPTER 2(读书笔记)

    CHAPTER 2 Recipe 2-1. Initializing Variables Recipe 2-2. Initializing Objects with Initializer Lists ...

  3. [REPRINT] Java 101: Classes and objects in Java

    http://www.javaworld.com/article/2979739/learn-java/java-101-classes-and-objects-in-java.html?page=3 ...

  4. Google C++ Style Guide

    Background C++ is one of the main development languages used by many of Google's open-source project ...

  5. iOS:消除项目中警告

    引言: 在iOS开发过程中, 我们可能会碰到一些系统方法弃用, weak.循环引用.不能执行之类的警告. 有代码洁癖的孩子们很想消除他们, 今天就让我们来一次Fuck 警告!! 首先学会基本的语句: ...

  6. 【转】clang warning 警告清单(备查,建议直接command + F 速查 )

    Warning Message -WCFString-literal input conversion stopped due to an input byte that does not belon ...

  7. 【译】C++工程师需要掌握的10个C++11特性

    原文标题:Ten C++11 Features Every C++ Developer Should Use 原文作者:Marius Bancila 原文地址:codeproject 备注:非直译,带 ...

  8. 使用#pragma阻止一些warnings

    这篇博客的内容都是记的网上的.是流水账.只是记录下来以便日后之有,避免每次重新google. #pragma除了可以用来把不同功能的代码进行分隔组织外还可以用来disable一些warnings.这在 ...

  9. iOS -- warnings

    Semantic Warnings Warning Message -WCFString-literal input conversion stopped due to an input byte t ...

随机推荐

  1. java 获取当月第一天和最后一天 获取前一个月第一天和最后一天

    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");                    //获取前月的第一 ...

  2. 从append追加的<tr>里传ID参数给js函数

    今天这个小问题几乎把我整崩溃 $.each(data.list, function (index, item) { i++; shenhe = "待审核"; tixing = it ...

  3. MSSQL sp_helptextplus

    默认的sp_helptext 如果存储过程每行代码太长会自动截断 把这个sp_helptextplus添加到SSMS的keyboard快捷键里面 SET QUOTED_IDENTIFIER ON SE ...

  4. jquery实现旋转木马的插件slick

    旋转木马的是一般网站上都会有的图片轮播效果, html: <section id="features" class="blue" style=" ...

  5. 《Benign and maligenant breast tumors classification based on region growing and CNN segmentation》翻译阅读与理解

    注明:本人英语水平有限,翻译不当之处,请以英文原版为准,不喜勿喷,另,本文翻译只限于学术交流,不涉及任何版权问题,若有不当侵权或其他任何除学术交流之外的问题,请留言本人,本人立刻删除,谢谢!! 另:欢 ...

  6. thinkPHP--SQL查询

    一.查询方式 ThinkPHP 提供了三种基本的查询方式:字符串条件查询.索引数组条件查询和对象条件查询. 在大多数情况下,推荐使用索引数组和对象方式作为查询条件,因为会更加安全 1.使用字符串作为条 ...

  7. python基础知识---迭代器、生成器、装饰器

    一.迭代器 二.生成器 http://www.cnblogs.com/huxi/archive/2011/07/14/2106863.html def func(): #定义生成器,和普通函数的区别是 ...

  8. nodejs+mysql

    接着上一篇的php+mysql,我们来试一试nodejs怎么实现数据的增删查改. Node.js 是一个基于 Chrome V8 引擎的 JavaScript 运行环境.Node.js 使用了一个事件 ...

  9. ios 判断相册文件图片大小的方法

    ALAssetsLibrary* alLibrary = [[ALAssetsLibrary alloc] init]; [alLibrary assetForURL:[info objectForK ...

  10. 2 Egg Problem

    继续我们的推理问题之旅,今天我们要对付的是一个Google的面试题:Two Egg Problem. 我们开始吧! No.2  Google Interview Puzzle : 2 Egg Prob ...