Hi Pierre! First all, thank you for reading. The reason why I didn't use std::variant is because it is not available on a freestanding environment. For purposes of demonstration, I made the code compilable in a regular environment and thus used the libraries available in and . On my kernel code, I am having to reimplement it all, as they are not available. I will probably reimplement something on the lines of std::variant when the necessity arises.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi!
You can add 'cpp' after the triple back-ticks in order to color your code ;)
Since you decide not to support old stuff, why didn't you choose to use std::variant from C++17?
A quickly written code gave me this (its's not as complete as yours, of course):
This code prints:
Hi Pierre! First all, thank you for reading. The reason why I didn't use std::variant is because it is not available on a freestanding environment. For purposes of demonstration, I made the code compilable in a regular environment and thus used the libraries available in and . On my kernel code, I am having to reimplement it all, as they are not available. I will probably reimplement something on the lines of std::variant when the necessity arises.