Questions tagged [c++20]
Code that is written to the 2020 version of the C++ standard. Use in conjunction with the 'c++' tag.
362 questions
5
votes
2
answers
351
views
MinMaxStack - tracks minimum and maximum values
I'm implementing a MinMaxStack<T> in C++20 that tracks minimum and maximum values. The class needs T to support ...
7
votes
3
answers
803
views
C++17/20 templated LRU cache : how should get* handle misses? (exception vs std::optional vs pointer)
I’m implementing a templated LRU cache in C++17 and C++20.
High-level design:
Recency: ...
4
votes
2
answers
627
views
Reference counted smart pointer with concept
I wrote a simple reference counted smart pointer. The reference count is supposed to be inside the object it owns (not the smart ptr itself, like std::shared_ptr) ...
2
votes
2
answers
196
views
Affect a repetition of an argument N times (for array construction)
Consider the following (C++20) function (from the solution to this StackOverflow question):
...
7
votes
1
answer
265
views
RAII Wrapper For Registering/Mapping CUDA Resources
I've implemented a resource management class for CUDA interop using RAII to ensure exception safety. The goal is to handle the registration/unregistration and mapping/unmapping, of graphics resources (...
1
vote
0
answers
94
views
Sphere Generation System With CUDA-OpenGL Interop
This is some kind of follow up to my previous question, this question will be more focused on the actual tessellating pipeline.
What I changed from previous question
Implemented the async sphere ...
5
votes
5
answers
1k
views
c++ format_to verbosity
I was concatenating a lot of strings lately, usually the results of std::format:
...
10
votes
3
answers
1k
views
C++17: shared_mutex protected DNS cache (rare writes, many reads) return-by-value vs decltype(auto)?
I’d appreciate a review of this small DNS cache.
It stores pairs of domain and IP address
and uses a std::shared_mutex because reads are frequent and writes are ...
1
vote
0
answers
80
views
generate_complex_image Template Function Implementation for Image in C++
This is a follow-up question for Tests for the operators of image template class in C++, Image pixelwise operation function with multiple inputs in C++ and An Updated Multi-dimensional Image Data ...
5
votes
2
answers
162
views
N-dimensional bilateral_filter Template Function Implementation for Image in C++
This is a follow-up question for An Updated Multi-dimensional Image Data Structure with Variadic Template Functions in C++ and bilateral_filter Template Function Implementation for Image in C++. The N-...
2
votes
1
answer
237
views
CoLib - A C++ Coroutine Library in a Single Header
I've developed a coroutine library for C++ that is contained within a single header file. It is compatible with both Windows and Linux platforms. This library is not multi-threaded; instead, it is ...
6
votes
2
answers
599
views
Shared_ptr-like solution to prolong the object's lifetime
I'm trying to implement something similar to shared_ptr except that the object is does not need to be allocated on the heap. Basically all the devices are populated ...
13
votes
5
answers
3k
views
Infinite precision integer in C++20
This is my infinite precision integer implemented in C++20. It supports negative numbers. I have implemented addition, subtraction, multiplication and binary integer division, which returns quotient ...
4
votes
1
answer
94
views
Timer coroutine
I was trying to learn more about C++ 20 coroutines. After trying to read the documentation and watching few videos, I tried to write a timer that uses coroutines.
...
5
votes
3
answers
254
views
Sieve of Eratosthenes with Wheel Factorization in C++ version 2
I have implemented Sieve of Eratosthenes with Wheel Factorization in C++ again, this time using a bigger wheel and much more complicated C++ syntax, to familiarize myself with C++ and see how fast I ...