CARVIEW |
Select Language
HTTP/2 200
date: Sat, 16 Aug 2025 22:51:28 GMT
content-type: text/html; charset=utf-8
content-encoding: gzip
cf-ray: 97047f1e09bf25e0-BLR
cf-cache-status: DYNAMIC
cache-control: private
set-cookie: prov=9168b54a-9b90-4abc-bea0-55a877390944; expires=Sun, 16 Aug 2026 22:51:28 GMT; domain=.stackexchange.com; path=/; secure; httponly
set-cookie: prov=9168b54a-9b90-4abc-bea0-55a877390944; Path=/; HttpOnly; Domain=stackexchange.com
set-cookie: __cf_bm=A.Gpup2385.gtr_Qi5Nwh0L8KiChm1cQ8aVx6Fg7mmI-1755384688-1.0.1.1-M655S0LT.upDkzN6JBBnR630kUFy9MOIdN53oa7ScpOKsuqJC4nk53seWB7AQcz12u4dARSkbozgl0a28EADJLAP2JDeJhv2eXeAULKG658; path=/; expires=Sat, 16-Aug-25 23:21:28 GMT; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
set-cookie: _cfuvid=qViuN_c8P60byLk_SyKi25Hgm0V_P9o.4G7i5okTpRA-1755384688976-0.0.1.1-604800000; path=/; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
strict-transport-security: max-age=31536000; includeSubDomains
vary: Accept-Encoding
content-security-policy: upgrade-insecure-requests; frame-ancestors 'self' https://stackexchange.com
x-clacks-overhead: GNU Terry Pratchett
x-frame-options: SAMEORIGIN
x-request-guid: b604e0f4-5ea1-48f5-9171-1b535df1d30e
x-worker-origin-response-time: 645000000
x-dns-prefetch-control: off
server: cloudflare
Newest 'generics' Questions - Code Review Stack Exchange
Skip to main content
Stack Exchange Network
Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack ExchangeTeams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about TeamsQuestions tagged [generics]
Generic programming is a style of computer programming in which algorithms are written in terms of to-be-specified-later types that are then instantiated when needed for specific types provided as parameters.
507 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
5
votes
1
answer
50
views
Created a Generic Row to do a lot of regular operation easily
I create generic Row to handle almost 90 percent of the basic feature.
I need your feedback to make it more flexible and extensible
...
1
vote
0
answers
65
views
A TypeScript library allowing to call socket.io events like pure functions
I'm creating a Typescript library (full repository here) whose goal is to be able to call socket.io events as regular functions:
Server side demo:
...
1
vote
0
answers
75
views
Generic sync.Map in Go
In one of our projects it became rather painful to use the Go standard library's sync.Map as it lacks type safety, i.e. it became rather tedious to do and check ...
7
votes
1
answer
286
views
Errors as values and Generic Option, Result types in C++
I wanted to get an in-depth view of both Templates and Concepts in C++, so I made this library. https://github.com/Hernanatn/errores--
I'd like to ask:
is this a proper use of concepts?
is the code ...
6
votes
1
answer
228
views
A generic function that reads a line of numeric values from a file
I'm writing a library of IO functions for my physics laboratory class. In the meanwhile, I'm hoping to learn more about generic programming and C++20 concepts.
Some context
I usually came home from ...
4
votes
2
answers
485
views
Second Try at C++ 20 Generic Dictionary for enums and Strings
This is a follow up question to Abstract Generic Dictionary. Some of the code reviewed in this question was also reviewed in C++20 Performance Test Code Generator.
The new template class attempts to ...
5
votes
1
answer
166
views
ConverterService: type conversion multitool
I got sick and tired of type-related errors and decided to write a type conversion service
It's not particularly pretty what with those casts and suppressions, but it seems to do what it was designed ...
4
votes
2
answers
121
views
Generic ring-buffer
What would be the preferred C way of implementing a simple generic ring-buffer.
Which approach from the 2 below (or even some 3rd) would you use and why?
Specifically, this will be part of an embedded ...
9
votes
4
answers
1k
views
Generic C++ Class to Associate enum Values with Strings for Translation
This is the first time I am using C++ templates in a very long time, and is the first time I have created a template class.
When developing projects I often run into a common problem: I have an enum ...
2
votes
1
answer
48
views
Dispatching generic calls and types in TypeScript
This is an expanded version of my question at SO: https://stackoverflow.com/questions/78929495/typescript-conditional-type-does-not-accept-value-even-when-all-branches-do
This is not real code (yes, ...
4
votes
3
answers
312
views
Type Traits for C with _Generic
Motivation:
Type traits are useful in defining robust function-like macros. Code below has:
IS_COMPATIBLE(EXPR, T)
IS_NULLPTR(T)...
6
votes
3
answers
185
views
An Attempt at Creating a Type-Safe, Generic Swap Macro With Compile Time Error Checking
Properties:
It evaluates each of A and B only once (sizeof is special, as it doesn't ...
1
vote
1
answer
88
views
Generic Min() for Integer Types (including Boolean)
This is a follow-up to Generic Max() for Integer Types (including Boolean) and An Attempt at Creating Generic Min()/Max() for Fundamental Types.
What's new:
MIN(), ...
8
votes
2
answers
199
views
Generic Max() for Integer Types (including Boolean)
This is a follow-up to An Attempt at Creating Generic min()/max() for Fundamental Types.
What's Changed:
MIN() has been forsaken for the time being.
Mixed types ...
9
votes
4
answers
1k
views
An Attempt at Creating Generic Min()/Max() for Fundamental Types
The simplest way one can achieve this is to have separate functions for each type with a suffix to differentiate between them like the following:
...
- The Overflow Blog
-
-
- Featured on Meta
-
Hot Network Questions
- Unable to complete authentication with Thunderbird or Betterbird
- Unexpected behavior of `Series` for version 14.3?
- SQL Server - Payroll query kills database every month
- Gravity same as free space?
- The art of making your own diy tubular bells
- How and where to place consecutive intercalary days in a lunisolar calendar with strictly lunar months, but an Earthlike solar year?
- What did Russell say about Carnap's claim that the sentence "Caesar is a prime number" is meaningless?
- I need help finding a breaker panel to swap the dead front
- According to John 16:11 (KJV), who is the 'prince of this world' and what is his condition according to the text?
- Ph.D. supervision when advisor moves
- Popping mustard seeds for a curry dish
- Name of this Q/QC experiment given a light polarization-entanglement complementary relation
- Any lip reading of what Putin and Trump discussed on the red carpet?
- According to OSAS advocates, why does God withdraw the gift of perseverance from those on rocky soil (Matthew 13:20-21, Luke 8:13)?
- What happens to the taxes already paid when the "Tariffs" are declared unlawful?
- Comparator crisp output
- Can a Pythagorean Triple have rational acute angles?
- Where do all the random thoughts and impressions come from?
- The multiplication table of a semigroup as a matrix
- Statistical type of topology
- What do native speakers commonly use for the Australian dollar: "$", "AU$" or "Australian dollars"?
- What kind of drinks would a strictly carnivorous alien consume?
- Confidence intervals for predictions in ggeffects are outside the possible range of probabilities
- Better way to search for a node in binary tree