Skip to main content

Questions tagged [c++20]

Code that is written to the 2020 version of the C++ standard. Use in conjunction with the 'c++' tag.

Filter by
Sorted by
Tagged with
1 vote
1 answer
66 views

c++ multithreaded message broadcaster with link lifetime management

note: A version of this code without link lifetime management was previously reviewed. Adding lifetime management actually made the code simpler, and the class simpler to use. I have written a class ...
Diederick C. Niehorster's user avatar
1 vote
1 answer
199 views

next/prev function for a circular array

This is a next/prev function for use in a circular array. What do you think? ...
user1095108's user avatar
  • 1,434
1 vote
1 answer
612 views

Generic decorator inspired by functional programming

I made a generic decorator in C++20 with concept for specialization. The idea is to be able to define only one function in the decorator to decorate all functions in a class. You may try it (it's a ...
Vincent LE GARREC's user avatar
1 vote
1 answer
1k views

c++ multithreaded message broadcaster using callbacks

note: This is an updated design after a previous review round. I have written a class that handles listeners registering callbacks to receive messages. Registered callbacks can be replaced or removed. ...
Diederick C. Niehorster's user avatar
1 vote
1 answer
89 views

A Function Applier for Applying Various Algorithms on Nested Container Things in C++

This is a follow-up question for A recursive_replace_if Template Function Implementation in C++, A recursive_copy_if Template Function Implementation in C++, A recursive_count_if Function with Unwrap ...
JimmyHu's user avatar
  • 5,214
1 vote
1 answer
86 views

An Element-wise Increment and Decrement Operator For Boost.MultiArray in C++

This is a follow-up question for A recursive_transform Template Function for BoostMultiArray and An Add/Minus Operator For Boost.MultiArray in C++. Besides the add / minus operator for Boost....
JimmyHu's user avatar
  • 5,214
1 vote
0 answers
38 views

recursive_remove_copy_if and recursive_remove_copy Template Functions Implementation with Execution Policy in C++

This is a follow-up question for recursive_remove and recursive_remove_if Template Function with Unwrap Level Implementation in C++. I am trying to implement ...
JimmyHu's user avatar
  • 5,214
1 vote
1 answer
34 views

recursive_remove and recursive_remove_if Template Function with Unwrap Level Implementation in C++

This is a follow-up question for recursive_find and recursive_find_if_not Template Functions Implementation in C++ and A recursive_copy_if Template Function Implementation with Unwrap Level ...
JimmyHu's user avatar
  • 5,214
1 vote
0 answers
47 views

An Updated recursive_transform_reduce Template Function with Unwrap Level Implementation in C++

This is a follow-up question for A recursive_transform_reduce Template Function with Unwrap Level Implementation in C++. To fix the issue mentioned in G. Sliepen's answer, I updated the test cases and ...
JimmyHu's user avatar
  • 5,214
1 vote
0 answers
59 views

Stand/Bench for testing emergency situations for 2p2 networks in games

In fact, this is a throttling proxy. It can work in two modes: "paired" and "multi-Client". In "pair" mode, two clients connect to each other through a proxy, very ...
Alexovsky's user avatar
1 vote
1 answer
58 views

A recursive_find_if_all Template Function Implementation in C++

This is a follow-up question for recursive_any_of and recursive_none_of Template Functions Implementation in C++. I am trying to follow the suggestion of G. Sliepen's answer to implement ...
JimmyHu's user avatar
  • 5,214
1 vote
0 answers
66 views

C++ registry class which manages game object, components and systems in an ECS

So this is my header file (registry.hpp): ...
Aspect11's user avatar
  • 145
1 vote
0 answers
87 views

An Updated recursive_transform Template Function Implementation in C++

This is a follow-up question for A recursive_transform_view Template Function Implementation and A recursive_transform_view Template Function which returns a view in C++. In those implementations ...
JimmyHu's user avatar
  • 5,214
1 vote
0 answers
72 views

A recursive_reduce Template Function with Unwrap Level Implementation in C++

This is a follow-up question for A recursive_sum Template Function Implementation with Unwrap Level in C++ and A recursive_reduce_all Template Function ...
JimmyHu's user avatar
  • 5,214
1 vote
0 answers
83 views

A recursive_unwrap_type_t Struct Implementation in C++

This is a follow-up question for A recursive_sum Template Function Implementation with Unwrap Level in C++. As G. Sliepen's answer mentioned, I am trying to implement a recursive struct for retrieve ...
JimmyHu's user avatar
  • 5,214
1 vote
0 answers
69 views

A batch_recursive_count_if Function with Unwrap Level for Various Type Arbitrary Nested Iterable Implementation in C++

This is a follow-up question for A recursive_count_if Function For Various Type Arbitrary Nested Iterable Implementation in C++ and A recursive_count_if Function with Unwrap Level for Various Type ...
JimmyHu's user avatar
  • 5,214
1 vote
0 answers
213 views

"tuple with named fields" implementation

I'd like to show you a type I made while experimenting with literal, non-type template parameters in C++20. The idea is to provide a type that wraps up tuple-like types (std::tuple, std::pair, even ...
Fabio A.'s user avatar
  • 261
1 vote
0 answers
77 views

A recursive_replace_copy_if Template Function Implementation in C++

This is a follow-up question for A recursive_copy_if Template Function Implementation in C++. Besides the recursive version std::ranges::copy_if, I am trying to ...
JimmyHu's user avatar
  • 5,214
1 vote
0 answers
58 views

A non-nested test_vectors_generator Function for arithmetic_mean Function Testing in C++

This is a follow-up question for An arithmetic_mean Function For Various Type Arbitrary Nested Iterable Implementation in C++. As Toby Speight's answer mentioned, some self-checking unit tests are ...
JimmyHu's user avatar
  • 5,214
1 vote
0 answers
61 views

std::deque and std::list Type Arbitrary Nested Iterable Generator Functions Implementation in C++

This is a follow-up question for std::array and std::vector Type Arbitrary Nested Iterable Generator Functions Implementation in C++ and the previous questions about recursive functions, including A ...
JimmyHu's user avatar
  • 5,214
0 votes
1 answer
62 views

Class accepting data input by variable, function pointer or lambda

Background I am writing a library that takes some data from the user and works with it. I was experimenting with ways to allow users to provide the data by the following methods: As a (global) ...
Armandas's user avatar
  • 103
0 votes
1 answer
80 views

wtpdmt - Windows thread preemption duration measurement tool (C++)

I have this repository. The idea is that the user may measure for how long the thread is preempted with given priority class/thread priority. CommandLineParser.h: <...
coderodde's user avatar
  • 28.7k
0 votes
1 answer
116 views

The usages of make_view Template Function in C++

This is a follow-up question for A recursive_transform_view Template Function which returns a view in C++. I am trying to revise the structure of recursive_transform...
JimmyHu's user avatar
  • 5,214
0 votes
1 answer
195 views

C++20 Wrapper class for an unsigned integer type and a templated derived class that codes modular arithmetic type

The context is a library to represent numbers (in this case integers) by wheighted position by radix powers for every radix R, passed as template argument. These derived types are digits of radix R, ...
Earendil's user avatar
0 votes
1 answer
168 views

Advent of Code 2021 Day 4: Play Bingo against a Giant Squid

[This is my first post here - though I have been lurking in the back reading, plussing, and hopefully learning for over two years] Below is my solution for Advent of Code 2021 Day 4, where you are ...
Aganju's user avatar
  • 189
0 votes
2 answers
55 views

Allow caller optional flags for returns

Checking return flags is generally very important. But, when you don't need to based on meeting pre-conditions, the syntax gets unnecessarily ugly. This class allows returning a value with flags that ...
Glenn Teitelbaum's user avatar
0 votes
1 answer
749 views

Writing a buffer that takes a header and a variable number of packets and makes a payload [closed]

I'm writing this as an exercise. I would probably use a vector as a buffer internally (the extra capacity pointer overhead is not important enough). Primarily it's an exercise in writing copy/move ...
Payal's user avatar
  • 3
0 votes
1 answer
98 views

Image pixelwise operation function with multiple inputs in C++

This is a follow-up question for Tests for the operators of image template class in C++ and A recursive_transform template function for the multiple parameters cases in C++. I appreciated G. Sliepen's ...
JimmyHu's user avatar
  • 5,214
0 votes
1 answer
86 views

extents_to_array and array_to_extents functions for Boost.MultiArray in C++

This is a follow-up question for A get_extents helper function for Boost.MultiArray in C++. In order to retrieve, manipulate and calculate size information in each dimension from Boost.MultiArray in ...
JimmyHu's user avatar
  • 5,214
0 votes
1 answer
254 views

Best practice for factory pattern in c++?

I'm implementing a simple data reader to get image sequences from either a pre-recorded video file (In my case ROS bag file), or a camera device (In my case Intel Realsense). Basically I intend for ...
zhouch's user avatar
  • 3

1
3 4 5 6
7