Skip to content

Commit ee4daf5

Browse files
committed
Integrate sample and include cleanups from imneme/pcg-cpp/commit/be22608 (by brt-v)
1 parent d5a77b2 commit ee4daf5

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

CREDITS.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,18 @@ This modernized fork of `pcg-cpp` by **Total-Random** integrates several critica
2929
- **Author:** [Demonese](https://github.com/Demonese)
3030
- **Description:** Added native support for ARM64 on MSVC using `__umulh` for efficient 128-bit multiplication.
3131

32+
### 6. Sample and Include Cleanups
33+
- **Origin:** [imneme/pcg-cpp commit be22608](https://github.com/imneme/pcg-cpp/commit/be22608ebcbe3aa0606600975705e2820600ed4e)
34+
- **Author:** [brt-v](https://github.com/brt-v)
35+
- **Description:** Simplified header includes in sample programs and added `basic_usage.cpp` sample.
36+
3237
## Total-Random Improvements
3338

34-
### 6. Modern CMake Build System
39+
### 7. Modern CMake Build System
3540
- **Author:** [Total-Random](https://github.com/Total-Random)
3641
- **Description:** Comprehensive CMake integration with `find_package` support and automated testing via `ctest`.
3742

38-
### 7. MSVC Compatibility Fixes
43+
### 8. MSVC Compatibility Fixes
3944
- **Author:** [Total-Random](https://github.com/Total-Random)
4045
- **Description:** Resolved several MSVC-specific issues:
4146
- `C2678` (ambiguous operator) in `set_stream` and `operator>>`.

sample/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
set(SAMPLE_TARGETS pcg-demo codebook cppref-sample make-partytrick)
1+
set(SAMPLE_TARGETS basic_usage pcg-demo codebook cppref-sample make-partytrick)
22

33
foreach(sample ${SAMPLE_TARGETS})
44
add_executable(${sample} ${sample}.cpp)

sample/basic_usage.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
#include "pcg_random.hpp"
3+
4+
int main()
5+
{
6+
pcg32 rng(42);
7+
return rng() + rng();
8+
}

sample/pcg-demo.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,8 @@
2424
* It shows some basic generation tasks.
2525
*/
2626

27-
#include <cstddef>
28-
#include <cstdint>
29-
#include <cstdlib>
30-
#include <cassert>
31-
#include <climits>
3227
#include <iostream>
3328
#include <iomanip>
34-
#include <algorithm>
3529
#include <numeric>
3630
#include <random> // for random_device
3731

sample/spew.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@
2929
* ./spew | hexdump -C | less
3030
*/
3131

32-
#include <cstdio>
33-
#include <cstddef>
34-
#include <cstdint>
3532
#include <iostream>
3633
#include <random>
3734

sample/use-partytrick.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,8 @@
2828
* ./use-partytrick | hexdump -C | less
2929
*/
3030

31-
#include <cstdio>
32-
#include <cstddef>
33-
#include <cstdint>
3431
#include <iostream>
3532
#include <sstream>
36-
#include <string>
3733
#include <random>
3834

3935
#include <unistd.h>

0 commit comments

Comments
 (0)