cpp: Adapt to Boost 1.56 optional changes

Some details of how boost::optional works appear to have changed slightly in the new release of Boost.

- Explictly dereference optional values
- Use double negative for comparing to true

--------

Testing: MacOS X CI nodes should go back to green; all CI nodes should be green.