Skip to content
Snippets Groups Projects
  • Jonathan Wakely's avatar
    f4874691
    libstdc++: Remove unnecessary variant member in std::expected · f4874691
    Jonathan Wakely authored
    Hui Xie pointed out that we don't need a dummy member in the union,
    because all constructors always initialize either _M_val or _M_unex.
    
    We still need the _M_void member of the expected<void, E>
    specialization, because the constructor has to initialize something when
    not using the _M_unex member.
    
    libstdc++-v3/ChangeLog:
    
    	* include/std/expected (expected::_M_invalid): Remove.
    f4874691
    History
    libstdc++: Remove unnecessary variant member in std::expected
    Jonathan Wakely authored
    Hui Xie pointed out that we don't need a dummy member in the union,
    because all constructors always initialize either _M_val or _M_unex.
    
    We still need the _M_void member of the expected<void, E>
    specialization, because the constructor has to initialize something when
    not using the _M_unex member.
    
    libstdc++-v3/ChangeLog:
    
    	* include/std/expected (expected::_M_invalid): Remove.