Skip to main content
17 votes
2 answers
870 views

Whereas: std::function has a single type, i.e template <typename Sig> std::function<Sig>; std::function_ref is variadic, i.e template< class...> class function_ref; (and all ...
Jarod42's user avatar
  • 230k
5 votes
1 answer
78 views

I'm brand new to Assembly, and I'm trying to figure out how to get my fibonacci program to work. However, it only prints 0's, no matter what I put in the x1 register. What am I doing wrong (or ...
Thomas Gorgij's user avatar
3 votes
1 answer
106 views

Consider this test case. function test() return 1, 2, 3 end -- OK: prints 4 1 2 3 print (4, test()) -- NOT OK: prints 1 4 print (test(), 4) Why do values returned from a function in a function ...
GreenScape's user avatar
  • 8,218
0 votes
0 answers
54 views

I would like to convert an arbitrary number of std::vector<T> to the same number of std::span through a variadic function template. I tried (almost) all the combinations, still it does not ...
Romain's user avatar
  • 47
3 votes
2 answers
184 views

I want to have the default property correctly infer the ArkType Type from the schema property, infinitely deep and infinitely wide. Accomplishing simple inference was easy... with the use of a ...
inducingchaos's user avatar
4 votes
2 answers
114 views

The overloaded variadic version of a function is supposed to have the lowest priority, when the compiler chooses a template specialization. However, this is not the case when a function argument has ...
Tiramisu's user avatar
0 votes
3 answers
173 views

I am trying to forward non-template variadic arguments between two functions. None of those functions is mine so I can't change their signatures. I used va_args for that purpose but (unluckily) my ...
Johny Siemano Kolano's user avatar
-1 votes
3 answers
169 views

Edit: Reformatting the entire question Making a Linked List lib, and I wanted to pass through multiple values in order to make the appending of items easier, so I created some Variadic Functions, ...
Gursimranjit's user avatar
2 votes
2 answers
105 views

I am trying to write a generic class for a symmetric bloc matrix of arbitrary dimension. Only the upper triangular part is given: A B C D E F so the number of blocks is n*(n+1)/2 where n is the ...
Charlie Vanaret - the Uno guy's user avatar
1 vote
1 answer
258 views

To begin with I have this code, which works totally fine: protocol ComponentAccessible {} extension ComponentAccessible { func components<each T>(_ keyPaths: repeat KeyPath<Self, each T&...
Roman's user avatar
  • 1,520
0 votes
2 answers
111 views

I have objects that are currently initialized via one-parameter init functions that take an Array or Dictionary. I've realized that I can use ExpressibleByArrayLiteral and ...
pkamb's user avatar
  • 35.6k
3 votes
1 answer
90 views

I have a class with multiple constructors, one being variadic and one taking an additional callable before the variadic arguments. However, the objects I create result in overload resolutions I dont ...
Philipp317's user avatar
1 vote
4 answers
394 views

I want to implement a function that take a function and its arguments then call it. I have search a lot and could not implement it with variadic function. I want a clean way to record stdio after ...
Saeedou's user avatar
  • 11
1 vote
1 answer
483 views

There are two evolution proposals: Variadic Generics and Value and Type Parameter Packs. So... what is the difference? They feel conceptually very similar. The second one, with super heavy syntax, is ...
Roman's user avatar
  • 1,520
0 votes
2 answers
365 views

protocol myProtocol {} func doSomething(with params: (some myProtocol)...) { // Implementation goes here } extension Int: myProtocol {} doSomething(with: 1, 2, 3) Compilation error at the func ...
Roman's user avatar
  • 1,520

15 30 50 per page
1
2 3 4 5
47