 
            
            
            
            
                30 May
                
                    2017
                
            
            
                30 May
                
                '17
                
            
            
            
        
    
                11:01 p.m.
            
        Andrzej Krzemienski wrote:
``` expected<vector<T>> mahe_vec() { expected<vector<T>> ans {value}; // creates an empty vector in-place vector<T> & vec = ans.value(); // ... } ``` Niall has indicated a number of times that the second defensive if is removed in context like the following:
``` if (ans.has_value()) ans.value(); // second check elided ```
But in my case with `vector` there is no first check, but I am still sure the value is there because I can trace the entire (quite triviall) life-time of the object.
It's still elided, because the compiler can see that you're doing the equivalent of storing `true` into `has_value_`.