]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
compressor: build without "using namespace std"
authorKefu Chai <kchai@redhat.com>
Wed, 11 Aug 2021 04:02:35 +0000 (12:02 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 13 Aug 2021 04:23:38 +0000 (12:23 +0800)
* add "std::" prefix in headers
* add "using" declarations in .cc files.

so we don't rely on "using namespace std" in one or more included
headers.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/compressor/lz4/LZ4Compressor.h

index fed98cec229ed964e3452a337a0b6fd347a8f268..8fb87d1c3d1bdcca8ab0f0997e0063775ec67e83 100644 (file)
@@ -118,7 +118,7 @@ class LZ4Compressor : public Compressor {
 
     ceph::buffer::ptr cur_ptr = p.get_current_ptr();
     ceph::buffer::ptr *ptr = &cur_ptr;
-    optional<ceph::buffer::ptr> data_holder;
+    std::optional<ceph::buffer::ptr> data_holder;
     if (compressed_len != cur_ptr.length()) {
       data_holder.emplace(compressed_len);
       p.copy_deep(compressed_len, *data_holder);