Skip to content

Commit c88a045

Browse files
# Conflicts: # README.md
2 parents 61df3a4 + f17515d commit c88a045

File tree

8 files changed

+165
-148
lines changed

8 files changed

+165
-148
lines changed

.editorconfig

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*]
7+
indent_style = tab
8+
indent_size = 4
9+
trim_trailing_whitespace = true
10+
11+
# C++
12+
[*.{c,cc,cpp,hpp,h}]
13+
indent_style = space
14+
indent_size = 2
15+
trim_trailing_whitespace = true
16+
max_line_length = 80
17+
18+
# Tab indentation (no size specified)
19+
[Makefile]
20+
indent_style = tab
21+
22+
# The indent size used in the `package.json` file cannot be changed
23+
# https://github.com/npm/npm/pull/3180#issuecomment-16336516
24+
[{.travis.yml,npm-shrinkwrap.json,package.json}]
25+
indent_style = space
26+
indent_size = 2

README.md

+9-5
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,12 @@ C++ exceptions are intended to used as an error reporting mechanism and thus the
159159

160160
Using Google's microbenchmark library (see the src/benchmark folder) we observe that the implicit up-cast is ~100x slower than the basic cast to the same type held by ```any_shared_ptr```.
161161

162-
|**any_shared_ptr**|Benchmark (x64) |MSVC 2017|GCC 6.2|Clang 3.9|
162+
|**any_shared_ptr**|Benchmark (x64) |MSVC 2017|GCC 6.2|Clang 3.8|
163163
|-|-|-|-|-|
164-
|any_shared_ptr_cast< Derived >(any)|Cast to same type|27 ns|15 ns|16 ns|
165-
|any_shared_ptr_cast< Base >(any)|up-cast|2232 ns|2040 ns|2050 ns|
164+
|any_shared_ptr_cast< Derived >(any)|Cast to same type|27 ns|14 ns|14 ns|
165+
|any_shared_ptr_cast< const Derived >(any)|Cv-qualifier promotion|2151 ns|2014 ns|2052 ns|
166+
|any_shared_ptr_cast< Base >(any)|up-cast|2318 ns|2048 ns|2092 ns|
167+
|any_shared_ptr_cast< int >(any)|Bad cast|4551 ns|3608 ns|5147 ns|
166168

167169

168170

@@ -218,10 +220,12 @@ const Derived* const_derived = any_ptr_cast< const Derived >( any );
218220
Base* base = any_ptr_cast< Base >( any );
219221
```
220222
## Benchmarks
221-
|**any_ptr**|Benchmark (x64) |MSVC 2017|GCC 6.2|Clang 3.9|
223+
|**any_ptr**|Benchmark (x64) |MSVC 2017|GCC 6.2|Clang 3.8|
222224
|-|-|-|-|-|
223225
|any_ptr_cast< Derived >(any)|Cast to same type|5 ns|2 ns|2 ns|
224-
|any_ptr_cast< Base >(any)|Up-cast|2200 ns|1950 ns|2080 ns|
226+
|any_ptr_cast< const Derived >(any)|Cv-qualifier promotion|2182 ns|1939 ns|2018 ns|
227+
|any_ptr_cast< Base >(any)|Up-cast|2230 ns|1964 ns|2089 ns|
228+
|any_ptr_cast< int >(any)|Bad cast|4441 ns|3688 ns|5102 ns|
225229

226230
## References
227231

0 commit comments

Comments
 (0)