cpp: Adapt to Boost 1.56 optional changes

- Explictly dereference optional values
- Use double negative for comparing to true
Merge pull request #1370 from rleigh-dundee/cpp-optional-fix

cpp: Adapt to Boost 1.56 optional changes