mirror of
https://github.com/lux-tel/libsession-util.git
synced 2026-10-30 20:25:11 +00:00
This code was using std::any, which has warts when used for fixed types: it ended up needing some gross macro uses rather than cleaner templating, and could not catch invalid types at compile time. Additionally it broke under older distros for some reason (perhaps because of a missing <any> header, but no matter). This replaces it with a simpler `network::opt::any` instead of `std::any` which is actually a variant, and results in cleaner code: both getting rid of the macro, allowing compile time checks, and removing the need for the `base` class layer under every option (is-a-base is now replaced with is_option<T>). Also changes the std::optional<OPTION> handling to avoid an extra value copy/move.