File tree Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- layout : blog
3
2
title : C++手稿:指针与引用
4
3
tags : C++ STL 内存 引用 指针 数组 函数指针 智能指针 析构函数 栈空间
5
4
---
@@ -162,5 +161,5 @@ auto_ptr<Investment> invest(){
162
161
> ` shared_ptr ` 的引用计数很像垃圾回收,然而它并不能解决环状引用的问题。
163
162
164
163
[ item13 ] : /2015/08/02/effective-cpp-13.html
165
- [ item41 ] : /2015/08/23 /effective-cpp-41.html
164
+ [ item41 ] : /2015/09/08 /effective-cpp-41.html
166
165
Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ void f(){} // 注意:这里没有"模板实参"
117
117
` std ` 是一个特殊的命名空间,用户可以特化其中的模板,但不允许添加模板(其实任何内容都是禁止添加的)。
118
118
因此在` std ` 中添加重载函数是不允许的,在[ Effective C++: Item 25] [ item25 ] 中给出了一个更详细的案例。
119
119
120
- [ meta ] : /2015/08/25/2015-09-16- effective-cpp-48.html
120
+ [ meta ] : /2015/09/16/ effective-cpp-48.html
121
121
[ partial ] : http://en.cppreference.com/w/cpp/language/partial_specialization
122
122
[ full ] : http://en.cppreference.com/w/cpp/language/template_specialization
123
123
[ item25 ] : /2015/08/23/effective-cpp-25.html
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ tags: Bash Github Vim grep awk sed JSON Jekyll
59
59
]{% endraw %}
60
60
```
61
61
62
- 它生成的页面就是一个JSON文件(也可以访问 http://harttle.land/tags.json 查看):
62
+ 它生成的页面就是一个JSON文件(也可以访问 http://harttle.land/api/ tags.json 查看):
63
63
64
64
``` json
65
65
[
@@ -74,25 +74,25 @@ tags: Bash Github Vim grep awk sed JSON Jekyll
74
74
]
75
75
```
76
76
77
- 这个文件位于` _site/tags.json ` ,这便是标签库。
77
+ 这个文件位于` _site/api/ tags.json ` ,这便是标签库。
78
78
79
79
# 生成标签的Bash脚本
80
80
81
81
首先这个Bash脚本应当接受一个文件名参数,给出要为哪篇文章生成标签。
82
- 然后去` _site/tags.json ` 读取标签列表,最后输出文章匹配的标签。
82
+ 然后去` _site/api/ tags.json ` 读取标签列表,最后输出文章匹配的标签。
83
83
84
84
``` bash
85
85
#! /bin/bash
86
86
# Usage: ./generate_tags.sh xxx.md
87
87
88
88
# generate tag list
89
- grep name ./_site/tags.json | awk -F : ' {print $2}' | tr -d ' ,\" ' > /tmp/tags.txt
89
+ grep name ./_site/api/ tags.json | awk -F : ' {print $2}' | tr -d ' ,\" ' > /tmp/tags.txt
90
90
91
91
# match tag string
92
92
grep $1 -oFf /tmp/tags.txt | sort | uniq | tr ' \n' ' ' | sed ' s/ $//' ; echo ' '
93
93
```
94
94
95
- 保存上述脚本为` ./scripts/generate_tags.sh ` ,该脚本分为两部分。首先读取` _site/tags.json ` 生成标签列表文件` /tmp/tags.txt ` :
95
+ 保存上述脚本为` ./scripts/generate_tags.sh ` ,该脚本分为两部分。首先读取` _site/api/ tags.json ` 生成标签列表文件` /tmp/tags.txt ` :
96
96
97
97
> 其中` awk ` 用来输出冒号后的标签名,` tr ` 用来移除逗号引号。
98
98
You can’t perform that action at this time.
0 commit comments