ネタ元:C++でMaybeモナド shand/maybe.hpp #ifndef SHAND_MAYBE_INCLUDE #define SHAND_MAYBE_INCLUDE #include <boost/variant.hpp> #include <boost/utility/result_of.hpp> #include <boost/bind.hpp> #include <algorithm> #include <utility> #include <vector> #include <ostream> namespace shand { class nothing {}; template <class T> class just { public: T val; just(const T& val) : val_(val) {} }; template <class T> s