Stack Exchange Network

Stack Exchange network consists of 175 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 Exchange

Questions tagged [variadic]

In computer science, an operator or function is variadic if it can take a varying number of arguments; that is, if its arity is not fixed.

5
votes
0answers
73 views

Extending functions to tuples

Intro: Imagine you have defined addition on types A and B with function A add(A,A) and <...
3
votes
0answers
39 views

Racket macro for variadic FFI

I'm working on FFI wrapper for SDL2 library in Racket. The library includes several variadic functions (e.g. SDL_SetError, SDL_LogMessage etc); Racket FFI does not have straight way for importing ...
3
votes
0answers
70 views

Determining if two packs are permutations of each other during compile-time

Often we need to find out if two tuples, or two packs in general, are the same as each other up to permutation. If there are no repeat types, then implementing ...
3
votes
0answers
211 views

Invoke callable object passing arguments in “groups of N” using C++17 fold expressions

Interactive Wandbox example Inspired by this Stack Oveflow question, I've implemented a function that, when called with a desired arity, a callable object, and a variadic amount of arguments, calls ...
1
vote
0answers
102 views

Variadic templates to generate SQL string

We have this old MFC code here which uses CString and format specifiers to generate an SQL statement and then execute that SQL. Something like this: ...
1
vote
0answers
317 views

A homemade variadic map

A bit of background: some time ago I wrote a piece of code that can be used for memoization with functions taking one parameter. Now I want to extend this to deal with functions with arbitrary number ...
1
vote
0answers
58 views

Creating class method using macro to accept Visitator for each of their fields

I had a lot of classes that used a macro with listed fields. The macro was used to serialization, more like MSGPACK_DEFINE. I need a substitution of this mechanism, ...