在C++中使用Lamada表达式

Lamada 表达式是 C++11 最重要也是最常用的特性之一。Lamada 来源于函数式编程的概念,也是现代编程语言的一个特点。

C++语言

编译器基础概念

一、C++代码编译流程以下面 C++代码为例: 1234567#include <stdio.h>​int main(){ printf("Hello World"); return 0;} 编译成二进制文件需要经过如下 4 个过程: 预编译:将 hello.c 和 stdio.h 预编译为 hello.i 编译:将 hello.i 编译为 hello.s 汇编:将 hello.s 翻译为机器指令 hello.o(.o 目标文件) 链接:链接各种需要的库和其他目标文件(该 hello 程序不需要)得到可执行文件 hello.out(相当于 windows 的.exe)。

C++语言

C++实现编译时断言

C++自 C++11 起支持 static_assert 编译时断言,如: 12static_assert ( bool_constexpr , message ) (C++11 起)static_assert ( bool_constexpr...

C++语言

C++ 匿名对象

在WebRTC的源码中有如下函数: 1234template <typename T>std::unique_ptr<T> WrapUnique(T* ptr) { return std::unique_ptr<T>(ptr);}

C++语言
12