From cf06ba6d132ed29616cad89c6ee23e5334025f97 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 28 Sep 2014 18:12:17 +0200 Subject: fs/AllocatedPath: add method Steal() --- src/fs/AllocatedPath.hxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/fs') diff --git a/src/fs/AllocatedPath.hxx b/src/fs/AllocatedPath.hxx index 42594b2f6..c345470c8 100644 --- a/src/fs/AllocatedPath.hxx +++ b/src/fs/AllocatedPath.hxx @@ -169,6 +169,14 @@ public: return *this; } + /** + * Allows the caller to "steal" the internal value by + * providing a rvalue reference to the std::string attribute. + */ + std::string &&Steal() { + return std::move(value); + } + /** * Check if this is a "nulled" instance. A "nulled" instance * must not be used. -- cgit v1.2.3