Adds a method getAsOr to Optional, This functions somewhat like getValueOr however it casts the value to a different type.
This is particularily useful if the type contained in the optional is expensive to construct.
Typical use cases would be for Optional<std::string>, It would often only be needed to access the value as a StringRef.
Similar approach can be made for ArrayRef.
This function is enabled for any type that can be statically casted from the type contained in the Optional