This is split into two patches:
* 1/2: Reorganizes headers to extract optional<T&> into separate
bits/optional_ref.hpp header, with minimal dependencies
* 2/2: Changes the exception_ptr_cast return type to optional<T&>
For the functions that would expand the dependencies of the optiona_ref
header, I have decided to define them out of line in <optional> header,
and it's include is necessary in the program. See commit message of
patch 2/2 for more details.
Is this approach we want to take? I think we really cannot make value
work, and transform/and_then would not be usable already without
<optional>.
The benefit of having really minimal set of dependencies on optional_ref.hpp,
is that it reduces changes of us reintroducing cyclce in the includes. I
think there is high chance that bits/utility.h, bits/stl_iterator.h or
bits/invoke.h may include <exception>.