Fix for issue #419

This pull request fixes issue #419.

The implementation is not optimal as it removes the implicit conversion operator from MSVC builds. Conversions to boost::optional<uint16_t> should therefore done explicitly from here on.
Let's do that then. I deliberately did it this way though so that users would have the option not to use conditional directives in their code and instead just use the explicit conversion.