#include <functional>
#include <string>
namespace maybe {
enum MaybeType{
  Nothing,
  Just
};
}

template<typename T>
class Maybe{
  virtual maybe::MaybeType getType() const = 0;
};

template<typename T>
class Just : public Maybe<T>{
  T value;
  virtual maybe::MaybeType getType() const{
    return maybe::MaybeType::Just;
  }
public:
  Just(T v) : value(v){}
};

template<typename T>
class Nothing : public Maybe<T>{
  virtual maybe::MaybeType getType() const{
    return maybe::MaybeType::Nothing;
  }
};

int main(){
  using namespace std;
  string s = "Hello";
  auto m=Just<string>(s);
}
