 
            
            
            
            
                2 Jun
                
                    2020
                
            
            
                2 Jun
                
                '20
                
            
            
            
        
    
                4:38 p.m.
            
        Alexander Grund wrote:
With an API like `result<Foo> do() noexcept` instead of `Foo do()` you won't get (N)RVO when you return a `Foo` (in the happy case) as the standard only allows it when the types are exactly the same.
This doesn't matter much nowadays. E.g. in https://godbolt.org/z/zC-Cah if you remove x.f(), x goes away.