Skip to content

Commit 8857e6f

Browse files
committed
🔧 fix some thing
1 parent 317b479 commit 8857e6f

File tree

6 files changed

+31
-13
lines changed

6 files changed

+31
-13
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ script:
8080
- mkdir build && cd ./build
8181
- cmake ..
8282
- make
83-
- cd ../bin && ./test
83+
- cd ../bin && ./stltest
8484

8585
branches:
8686
only:

CMakeLists.txt

+1-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ message(STATUS "The version of this project is: ${MyTinySTL_VERSION}")
1212
# build type
1313
set(CMAKE_BUILD_TYPE release)
1414

15-
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
16-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
17-
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
15+
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
1816
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wall")
1917
# set(EXTRA_CXX_FLAGS -Weffc++ -Wswitch-default -Wfloat-equal -Wconversion -Wsign-conversion)
2018
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8.0")

MyTinySTL/vector.h

-1
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,6 @@ template <class T>
728728
void vector<T>::
729729
__reallocate_and_insert(iterator pos, const value_type& value)
730730
{
731-
const auto old_size = size();
732731
const auto new_size = __growth_size(1);
733732
auto new_begin = data_allocator::allocate(new_size);
734733
auto new_end = new_begin;

README.md

+26-4
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,43 @@ MyTinySTL
77

88
## 简介
99
基于 `C++11``tinySTL`,并使用中文文档与中文注释,作为新手练习用途。实现了大部分 STL 中的容器与函数,但仍存在许多不足与 bug 。如发现错误,还请在 `Issues` 中指出,欢迎 `Fork``Pull requests` 改善代码,谢谢!<br>
10-
10+
1111
## 支持
1212

1313
* 操作系统
1414
* linux
1515
* windows
16+
* osx
1617
* 编译器
17-
* G++ 4.8
18-
* Clang++ 3.5
18+
* GCC 4.8
19+
* Clang 3.5
1920
* MSVC 14.0
21+
22+
## 需要
23+
* cmake 2.8 (使用g++/clang编译)
24+
25+
## 运行
26+
27+
* linux/osx
28+
1. git clone
29+
```shell
30+
$ git clone [email protected]:Alinshans/MyTinySTL.git
31+
```
32+
2. 构建并运行
33+
```shell
34+
$ mkdir build && cd ./build
35+
$ cmake ..
36+
$ make
37+
$ cd ../bin && ./stltest
38+
```
39+
40+
* windows
41+
使用 `vs2015`(或 `vs2017`)打开 `MyTinySTL.sln`,配置 `Relase` 模式,(Ctrl + F5)开始执行。
2042

2143
## 文档
2244
[Wiki](https://github.com/Alinshans/MyTinySTL/wiki)
2345

2446
## 测试
25-
[Test](https://github.com/Alinshans/MyTinySTL/tree/master/MyTinySTL/Test)
47+
[Test](https://github.com/Alinshans/MyTinySTL/tree/master/Test)
2648

2749

Test/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
include_directories(${PROJECT_SOURCE_DIR}/MyTinySTL)
22
set(APP_SRC test.cpp)
33
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
4-
add_executable(test ${APP_SRC})
4+
add_executable(stltest ${APP_SRC})

Test/Lib/redbud/io/color.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -324,10 +324,9 @@ template <typename T>
324324
inline details::color_return_t<T>
325325
operator<<(std::ostream& os, const T& value)
326326
{
327-
const std::streambuf* buf = os.rdbuf();
328327
return (os.iword(details::get_iword()) ||
329-
details::is_modifiable() &&
330-
details::is_terminal(os.rdbuf()))
328+
(details::is_modifiable() &&
329+
details::is_terminal(os.rdbuf())))
331330
? details::set_color(os, value)
332331
: os;
333332
}

0 commit comments

Comments
 (0)