title: How to use std::optional in C++
body: <p>In C++17 <code>std::optional</code> is introduced, I was happy about this decision, until I looked at the <a href="http://en.cppreference.com/w/cpp/utility/optional" rel="noreferrer">ref</a>. I know <code>Optional</code>/<code>Maybe</code> from Scala, Haskell and Java 8, where optional is a monad and follows monadic laws. This is not the case in the C++17 implementation. How am I supposed to use <code>std::optional</code>, whithout functions like <code>map</code> and <code>flatMap</code>/<code>bind</code>, whats the advantage using a <code>std::optional</code> vs for example returning <code>-1</code>, or a <code>nullptr</code> from a function if it fails to compute a result?
  And more important for me, why wasn't <code>std::optional</code> designed to be a monad, is there a reason?</p>