X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2FTry-inl.h;h=801344d446553897736339df681763d180571669;hb=HEAD;hp=e70fce72c8d807e50ad3beb79732d50ab0e68dc1;hpb=374d408bcd0283dffd5b0bec78685bc17e567c43;p=folly.git diff --git a/folly/Try-inl.h b/folly/Try-inl.h index e70fce72..801344d4 100644 --- a/folly/Try-inl.h +++ b/folly/Try-inl.h @@ -1,5 +1,5 @@ /* - * Copyright 2017 Facebook, Inc. + * Copyright 2014-present Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -117,6 +117,12 @@ const T& Try::value() const & { return value_; } +template +const T&& Try::value() const && { + throwIfFailed(); + return std::move(value_); +} + template void Try::throwIfFailed() const { switch (contains_) {