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.
79 questions
5
votes
5
answers
1k
views
c++ format_to verbosity
I was concatenating a lot of strings lately, usually the results of std::format:
...
2
votes
1
answer
269
views
An Updated Multi-dimensional Image Data Structure with Variadic Template Functions in C++
This is a follow-up question for Multi-dimensional Image Data Structure with Variadic Template Functions in C++. Considering the suggestion from G. Sliepen:
Make everything work for more than 5 ...
5
votes
1
answer
357
views
Multi-dimensional Image Data Structure with Variadic Template Functions in C++
This is a follow-up question for Three dimensional data structure in C++. I am trying to implement multi-dimensional image data structure with variadic template functions. For example, ...
3
votes
2
answers
459
views
Logger using variadic macros
I'm getting back into C and I wrote this variadic logger as part of a chess application I'm writing. As such I'm looking for feedback about the general approach (I'm going to give it another pass to ...
4
votes
2
answers
254
views
Transpose types variadicly
I want to do template metaprogramming to compute the conversion from std::variant<Ts...> to ...
4
votes
1
answer
2k
views
Template to unpack arguments to a std::function
I am writing some C++ code to interact with an external scripting language. I want to be able to register arbitrary C++ callable code as functions to be called from the script.
The scripting library ...
1
vote
2
answers
118
views
C++ variardic universal template for unknown types, used to handle multiple network protocols
I am creating a template function with variardic arguments, to handle a specific classes that have some interface, method, member or whatever is specialized in a specialization area. However I came to ...
2
votes
1
answer
518
views
splitting a tuple into N-element tuples
This nice hack should allow you to split a tuple into N-element tuples, thereby effectively splitting a tuple into pairs, triples, ... For example, this allows you to split an input parameter pack, ...
5
votes
3
answers
206
views
C function that emulates string concatenation operator '+' in Python or Go
I'm working on a project of mine which required multiple calls to strncat(), and it came to me that it'd have been much easier if C also had something like ...
1
vote
1
answer
138
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 ...
5
votes
1
answer
534
views
Using templates to wrap variardic JNI method calls into type-safe C++ functors
I am working on a project which uses JNI. More than once I fell over the absence of type safety working with the variardic function calls. So I came up with this module. It wraps the variardic JNI ...
5
votes
1
answer
212
views
Meta functions for sequences of exponents of 2
I have implemented some meta functions to create sequence for exponents of 2. I would love to know if there is any way to make the code more optimized.
Note: ...
1
vote
1
answer
350
views
Using vswprintf( ... ) to create wchar_t* with variable argument list
I am using c++17 and wide characters.
I have created a function to create a wchar_t* using a variable number of parameters ...
#include <stdarg.h>
// the ...
5
votes
1
answer
676
views
`zip` operator to iterate on multiple container in a sign
I worked out a zip operator similar to Python's, because I didn't find one in std. It allows to use range-based ...
7
votes
3
answers
876
views
Coalescing lvalue references to std-optionals
I want to coalesce (lvalue references to) optionals of the same type, in C++17:
...