Been using boost for this (what else is new?):
https://theboostcpplibraries.com/boost.optional
https://stackoverflow.com/questions/22227839/how-to-use-boos...
https://theboostcpplibraries.com/boost.optional
https://stackoverflow.com/questions/22227839/how-to-use-boos...