###C++ Primer第5版 学习笔记
####第五章
-
复合语句也被称作块,一个块就是一个作用域,名字的有效区域始于声明语句,终于声明语句所在的作用域末端
-
case 标签之后不一定必须换行,几个 case 标签可以写在一行
switch (ch) {
case 'a': case 'e': case 'i': case 'o': case 'u':
###C++ Primer第5版 学习笔记
####第五章
复合语句也被称作块,一个块就是一个作用域,名字的有效区域始于声明语句,终于声明语句所在的作用域末端
case 标签之后不一定必须换行,几个 case 标签可以写在一行
switch (ch) {
case 'a': case 'e': case 'i': case 'o': case 'u':
###C++ Primer第5版 学习笔记
####第六章
###C++ Primer第5版 学习笔记
####第七章
(synthesized default constructor)
仅当对未限定名字的正常名字查找不能发现匹配的名字,ADL才被使用。这时,函数实参的数据类型相关的命名空间也被搜索。 任何数据类型的T的相关的命名空间包括:
#include <iostream>
###C++ Primer第5版 学习笔记
####第十章
下面说的算法都是本章的泛型算法
auto sumstring = accumulate(strvec.cbegin(), strvec.end(), "");
会尝试使用 const char* 的加运算符,导致编译错误###C++ Primer第5版 学习笔记
####第十二章
auto p = make_shared<vector<string>>(5, "aaa");
,这种带初始化的,括号中的参数不能是单纯的列表初始化形式 *[list initialization (since C++11)][1]const int* cip = new const int(42);
###C++ Primer第5版 学习笔记
####第十三章
=default
显示要求编译器生成合成的函数,=delete
将函数定义为删除的函数来阻止该操作Gratuitous ARP
could mean both gratuitous ARP request or gratuitous ARP reply. Gratuitous in this case means a request/reply that is not normally needed according to the ARP specification (RFC 826) but could be used in some cases. A gratuitous ARP request is an Address Resolution Protocol
request packet where the source and destination IP are both set to the IP of the machine issuing the packet and the destination MAC is the broadcast address ff:ff:ff:ff:ff:ff
. Ordinarily, no reply packet will occur. A gratuitous ARP reply is a reply to which no request has been made.
GARP 指 GARP 请求或 GARP 响应.这里的 Gratuitous 指 ARP specification (RFC 826) 说明的在一般情况下,请求/响应报文都是没有必要的.一个 GARP 请求报文是也一个 ARP 请求报文,特别之处在于源 IP 和目的 IP 都是发送者的 IP,且目的 MAC 为ff:ff:ff:ff:ff:ff
,一般没有响应.GARP 响应是不针对任何请求的响应
####Gratuitous ARPs 主要有四个用处:
iptables -N http | |
iptables -A http -m string --string "HTTP/1.1 302 Moved Temporarily" --algo bm -j RETURN | |
iptables -A http -m string ! --string "HTTP/1.1 302 Found" --algo bm -j RETURN | |
iptables -A http -m string ! --string "Connection: close" --algo bm -j RETURN | |
iptables -A http -m string --string "videoplayer" --algo bm -j LOG --log-prefix "http_302" --log-level 5 | |
iptables -A http -m string --string "videoplayer" --algo bm -j DROP | |
iptables -A http -j LOG --log-prefix "WTF" --log-level 5 | |
iptables -I FORWARD -i eth0.2 -p tcp --sport 80 -m ttl --ttl-eq 127 -j http |
现整理收集C++世界里那些“牛人”的个人博客。凡三类:一是令人高山仰止的大牛,对C++语言本身产生过深远的影响的人;二是C++运用炉火纯青的高手,有原创性的技术干货;三是中文世界里的C++牛人。