Questions tagged [function-reference]
20 questions
0
votes
2 answers
Pass a Suspended-function reference as another function parameter
I have created a function that should get a suspended function as its parameter, run it, and perform some operations with the results.
When I try to call this function and pass a function reference from a different class (let us call it "SomeClass"…

ran8080
- 41
- 1
- 3
0
votes
2 answers
How paste works within a function
I have data frame like below
Col1 Col2
White Orange
White Blue
Red White
On executing the below code,the items from both columns adds together. Please explain how the function works and how does the function know it should add row…

Bet
- 13
- 4
0
votes
1 answer
Best practice in instantiating a function type in Kotlin
I was wondering, whether it is better (in a way of having clean code according to a best practice) to pass function as reference using a new code block (lambda expression) or using a callable reference to an existing declaration, whenever it is…

Lukas Forst
- 802
- 1
- 8
- 25
0
votes
5 answers
Why do callbacks have to be a function?
I keep on seeing:
() => execute code
instead of just
execute code
in callbacks. I am not passing in any parameters, so why does () => execute code work but execute code doesn't? Aren't they the same thing since a function just represents some…

FranktheTank
- 292
- 3
- 9
-1
votes
2 answers
Is it possible to reserve function reference into unordered_map or vector?
i am making some callback system and i wonder if i can reserve function reference to unordered_map so that i can invoke it later.
float func_imp(float x)
{
return x;
}
int main()
{
using Tumap = unordered_map;
Tumap…

liiight
- 25
- 1
- 7