blob: 4b6a8721ea8c1bef2e909c88ff79efefd238dd77 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# Taming C++
Experiments with C++ and comparisons with C.
## sort-benchmark
For the
[first post in the series](https://sebastiano.tronto.net/blog/2024-04-30-taming-cpp-motivation/).
Inspired by [Bert's post](https://berthub.eu/articles/posts/c++-1).
Sorting an array of integers is a simple task, so C and C++ should perform
similarly, right? Wrong!
```
C time for 100000000 numbers: 9.886314s
C++ time for 100000000 numbers: 4.92299s
C++ time for 100000000 numbers (parallel): 0.495435s
```
A similar benchmark is provided for sorting an arrays of pairs in a
non-standard way.
## raii
For the
[second post in the series](https://sebastiano.tronto.net/blog/2024-12-26-taming-cpp-raii/).
Various small examples on constructors, destructors and related things.
## Templates
For the
[third post](https://sebastiano.tronto.net/blog/2025-01-21-taming-cpp-templates)
Various examples on templates, constraints and concepts.
See also [zmodn](https://git.tronto.net/zmodn).
|