Skip to content

Commit 591aa71

Browse files
author
learnmoreonce
committed
rename
1 parent 1e9e200 commit 591aa71

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+958
-939
lines changed

EffectiveCpp/CMakeLists.txt

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,19 @@ SET(CMAKE_CXX_COMPILER "clang++")
77
aux_source_directory(. DIR_SRCS)
88
include_directories ("${PROJECT_SOURCE_DIR}/")
99

10-
#add_executable(muduo_ ${SOURCE_FILES} ${DIR_SRCS})
11-
#set(SOURCE_FILES main.cpp ch2.h ch3.h ch3_cast转型.h all.h ch4.h ch5.h ch6.h ch7.h ch9.h ch10.h Thread.cpp Thread.h TestThread.h Thread_base_object.h Thread_base_object_test.h ch12.h)
12-
add_executable(effectivecpp ${DIR_SRCS} ch13.h ch14.h ch15.h ch16.h ch20.h ch21.h)
13-
target_link_libraries(effectivecpp pthread)
10+
11+
add_executable(ch3 ch3.cc)
12+
add_executable(ch3_cast ch3_cast转型.cc)
13+
add_executable(ch4 ch4.cc)
14+
add_executable(ch5 ch5.cc)
15+
add_executable(ch7 ch7.cc)
16+
add_executable(ch8 ch8.cc)
17+
add_executable(ch9 ch9.cc)
18+
add_executable(ch10 ch10.cc)
19+
add_executable(ch11 ch11.cc)
20+
add_executable(ch12 ch12.cc)
21+
add_executable(ch13 ch13.cc)
22+
add_executable(ch14 ch14.cc)
23+
add_executable(ch16 ch16.cc)
24+
add_executable(ch20 ch20.cc)
25+
#target_link_libraries(effectivecpp pthread)

EffectiveCpp/TestThread.h

Lines changed: 0 additions & 70 deletions
This file was deleted.

EffectiveCpp/Thread.cpp

Lines changed: 0 additions & 40 deletions
This file was deleted.

EffectiveCpp/Thread.h

Lines changed: 0 additions & 29 deletions
This file was deleted.

EffectiveCpp/Thread_base_object.h

Lines changed: 0 additions & 42 deletions
This file was deleted.

EffectiveCpp/Thread_base_object_test.h

Lines changed: 0 additions & 87 deletions
This file was deleted.

EffectiveCpp/all.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
//
2-
// Created by shen on 16-9-15.
3-
//
1+
42

53
#ifndef EFFECTIVECPP_ALL_H
64
#define EFFECTIVECPP_ALL_H
@@ -10,4 +8,7 @@ using namespace std;
108
#include <vector>
119
#include <string>
1210
#include <list>
11+
#include <memory>
12+
#define sout(Xit) {std::cout<<__LINE__<<": "<< Xit <<""<<std::endl;}
13+
1314
#endif //EFFECTIVECPP_ALL_H

EffectiveCpp/ch1.cc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
3+
#ifndef EFFECTIVECPP_CH11_H
4+
#define EFFECTIVECPP_CH11_H
5+
/*
6+
* 视c++为一个语言联邦,多范式编程思想。
7+
* 包括:
8+
* 1),c式
9+
* 2),面向对象
10+
* 3),模板编程
11+
* 4),STL
12+
*/
13+
14+
#endif //EFFECTIVECPP_CH11_H

EffectiveCpp/ch1.h

Lines changed: 0 additions & 8 deletions
This file was deleted.

EffectiveCpp/ch10.cc

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
2+
#include "all.h"
3+
4+
/*
5+
*
6+
* 令operator=()返回一个 *this,引用。
7+
* */
8+
9+
10+
11+
class Widget
12+
{
13+
public:
14+
Widget()
15+
{ cout << "widget() \n"; }
16+
17+
Widget &operator=(const Widget &rhs)
18+
{
19+
cout << "= copy \n";
20+
return *this;
21+
}
22+
};
23+
24+
void f()
25+
{
26+
int x, y, z;
27+
x = y = z = 15;//等价
28+
x = (y = (x = 15));
29+
//=操作符返回指向左侧的引用reference
30+
31+
Widget w1,w2,w3;
32+
w1=(w2=w3);
33+
34+
35+
}
36+
int main()
37+
{
38+
39+
f();
40+
return 0;
41+
}

0 commit comments

Comments
 (0)