bitwizeshift / bitwizeshift/Delegate

How to initialize delegate with function pointer

Open
#2 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
26
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Dear Matthew Rodusek, THANKS for writing such an amazing blog about how to creating delegate type in c++. It really helps a lot. I'm trying to create a timer with a function pointer. I want it to do something like this.
```{c++}
void Task(int a){}
Timer<&task,1000> timer;
```
However, after mimic the delegate type, the best I can do is something like this.
```{c++}
Timer timer{1000};
timer.bind<&Task>();
```
I'm wondering if there's something that I can do to bind the function pointer in constructor in C++11. I'm really hoping to get some advice from a c++ expert like you. THANKS again for your fascinating post.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.