diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2023-06-05 00:07:21 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2023-07-05 00:07:21 +0200 |
commit | a930747329e7a428578e3e4af3f29a5c23f49ec7 (patch) | |
tree | 290c9d05abb4fc11f2e561f8eafa5b314b48afad /examples/dpp-example-cplusplus-EASTL.cpp | |
parent | 8eafe8f1b65193784c84eb9b35db2684b1e1dd2f (diff) |
Fixed ArchLinux build.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'examples/dpp-example-cplusplus-EASTL.cpp')
-rw-r--r-- | examples/dpp-example-cplusplus-EASTL.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/examples/dpp-example-cplusplus-EASTL.cpp b/examples/dpp-example-cplusplus-EASTL.cpp index d112a85..618bc68 100644 --- a/examples/dpp-example-cplusplus-EASTL.cpp +++ b/examples/dpp-example-cplusplus-EASTL.cpp @@ -32,6 +32,18 @@ typedef UNICODE_STRING * PUNICODE_STRING; typedef int NTSTATUS; #endif +struct GeneratorUint32 +{ + uint32_t mValue; + GeneratorUint32() : mValue(0) + { + } + uint32_t operator()() + { + return mValue++; + } +}; + using namespace eastl; // C&P from: https://raw.githubusercontent.com/sidyhe/dxx/ed06aba3b91fe8e101d08c33c26ba73db96acef0/README.md @@ -95,13 +107,15 @@ void more_stl_test() #endif uniform_int_distribution<std::uint32_t> uid(1, UINT32_MAX); - DbgPrint("PRNG: %u\n", uid); + GeneratorUint32 g; + DbgPrint("PRNG: %u\n", uid(g)); auto lambda = [] { DbgPrint("Hello lambda!\n"); }; function<void(void)> fn = lambda; fn(); - auto lambda2 = [](int n) { + auto lambda2 = [](int n) + { DbgPrint("Hello lambda2, %u!\n", n); return n; }; |