Lauen_1

Stay foolish

2016年11月6日

2-6 Working with Lambdas

摘要: 在C++中使用匿名函数,格式如下:[] () {}; Using a Lambda to Print array Values 1 #include <algorithm> 2 #include <array> 3 #include <cstdint> 4 #include <iostream> 5 阅读全文

posted @ 2016-11-06 16:56 Lauen_1 阅读(119) 评论(0) 推荐(0) 编辑

2-5. Working with Compile Time Constants

摘要: C++有时候为了运行效率,提供了很多的feature,虽然比较难用 关键字constexpr 就是在编译时进行推导,提升运行效率。 Using constexpr to Define the Size of an array Creating constexpr class Constructors 阅读全文

posted @ 2016-11-06 16:18 Lauen_1 阅读(174) 评论(0) 推荐(0) 编辑

2-4. Using auto with Functions

摘要: 在C++14中允许使用type deduction用于函数参数和函数返回值 Return Type Deduction in C++11 Deducing return types for C++11 template functions In order to reduce the verbose 阅读全文

posted @ 2016-11-06 15:49 Lauen_1 阅读(188) 评论(0) 推荐(0) 编辑

2-3. Using Type Deduction

摘要: Type Deduction 发生在编译时期 可以对一般类型,自定义类型进行类型自推导 下面有两个例子: 1. Using auto with a class 2.Using auto with Uniform Initialization use auto for local variables 阅读全文

posted @ 2016-11-06 15:16 Lauen_1 阅读(302) 评论(0) 推荐(0) 编辑

2-2. Initializing Objects with Initializer Lists

摘要: Using Uniform Initialization to Construct a vector 1.使用Uniform Initialization可以使得初始化比较方便。 2.using的使用也比较陌生 阅读全文

posted @ 2016-11-06 14:59 Lauen_1 阅读(142) 评论(0) 推荐(0) 编辑

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

摘要: CHAPTER 2 Recipe 2-1. Initializing Variables Recipe 2-2. Initializing Objects with Initializer Lists 使用初始化列表的使用 Recipe 2-3. Using Type Deduction 关于aut 阅读全文

posted @ 2016-11-06 14:36 Lauen_1 阅读(204) 评论(0) 推荐(0) 编辑

导航