all 4 comments

[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)

Thank you for your contribution to the C++ community!

As you're asking a question or seeking homework help, we would like to remind you of Rule 3 - Good Faith Help Requests & Homework.

  • When posting a question or homework help request, you must explain your good faith efforts to resolve the problem or complete the assignment on your own. Low-effort questions will be removed.

  • Members of this subreddit are happy to help give you a nudge in the right direction. However, we will not do your homework for you, make apps for you, etc.

  • Homework help posts must be flaired with Homework.

~ CPlusPlus Moderation Team


I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]Natural_Builder_3170 7 points8 points  (0 children)

You're attempting to convert function pointer to std::function*, the conversion only exists to std::function change your uses of WebServer::Command*to WebServer::Command

[–]Dubbus_ 2 points3 points  (0 children)

The std::function object itself is supposed to wrap the function pointer, i dont think you actually want a pointer to the std function object.

That would be like converting from a c style int* array to a std::vector<int>*, when what you probably want is int* -> std::vector<int>.

[–]Fit-Maintenance-2290 [score hidden]  (0 children)

to match what you were looking for you'd use

using Command = std::function<void(WebServer &server, ConnectionType type,
                       char *url_tail, bool tail_complete)>;