Just tried making my packet parsing constexpr until I realized I used std::function which requires function pointers which are themselves only decided at link time...
No constexpr for my parser :(
If anyone is interested by this problem here's the GitHub issue on it :)
Not sure how familiar you are with the language features there so feel free to ask if you want more explanation.
(also btw `_payload.erase(_payload.begin())` in your current code takes time proportional to the length of the payload so would be really slow for large packets if you're doing that for each byte)
(also lmao this definitely nerd sniped me)
@ralismark So I learned multiple things already, for example :
- I didn't know pointer-to-members were this good
- constexpr still things magic, cause damn that godbolt output is good XD
@ralismark Forgot to put the link to the commit XD
Fosstodon is an English speaking Mastodon instance that is open to anyone who is interested in technology; particularly free & open source software.