add optional template class (polyfill for C++14's std::optional)