revision #1: 更新第二章中已维护的代码

This commit is contained in:
Changkun Ou
2018-04-02 00:28:05 +02:00
parent 11efa38dba
commit 838d30ef5a
28 changed files with 460 additions and 111 deletions

View File

@@ -2,7 +2,7 @@
// 1.1.cpp
//
// chapter 1 introduction
// c++1x tutorial
// modern cpp tutorial
//
// created by changkun at changkun.de
//
@@ -12,7 +12,7 @@
#include <functional>
int main() {
// 使用 lambda 表达式
// use lambda expression
[out = std::ref(std::cout << "Result from C code: " << add(1, 2))](){
out.get() << ".\n";
}();

View File

@@ -2,21 +2,21 @@
# 1.1.cpp
#
# chapter 1 introduction
# c++1x tutorial
# modern cpp tutorial
#
# created by changkun at changkun.de
#
C = gcc
CXX = g++
CXX = clang++
SOURCE_C = foo.c
OBJECTS_C = foo.o
SOURCE_CXX = 1.1.cpp
SOURCE_CXX = 1.1.c.and.cpp
TARGET = 1.1
LDFLAGS_COMMON = -std=c++1z
TARGET = 1.1.out
LDFLAGS_COMMON = -std=c++17
all:
$(C) -c $(SOURCE_C)

View File

@@ -2,14 +2,14 @@
// foo.c
//
// chapter 1 introduction
// c++1x tutorial
// modern cpp tutorial
//
// created by changkun at changkun.de
//
#include "foo.h"
// C 语言代码
// C code
int add(int x, int y) {
return x+y;
}

View File

@@ -2,7 +2,7 @@
// foo.h
//
// chapter 1 introduction
// c++1x tutorial
// modern cpp tutorial
//
// created by changkun at changkun.de
//