Fix blobstore compilation on macOS and MSVC

macOS:

    src/blobstore.cc:25:73: error: typename specifier refers to non-type member 'impl' in 'org::blobstore::BlobstoreClient'
    BlobstoreClient::BlobstoreClient() : impl(new typename BlobstoreClient::impl) {}
                                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
    cxxbridge/crate/demo/include/blobstore.h:20:25: note: referenced member 'impl' is declared here
      std::shared_ptr<impl> impl;
                            ^

MSVC:

    src/blobstore.cc(25): error C2061: syntax error: identifier 'impl'
This commit is contained in:
David Tolnay 2020-11-10 23:11:24 -08:00
parent 4ca366fa57
commit ced948046e
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
2 changed files with 4 additions and 4 deletions

View File

@ -16,8 +16,8 @@ public:
BlobMetadata metadata(uint64_t blobid) const;
private:
class impl;
std::shared_ptr<impl> impl;
class Impl;
std::shared_ptr<Impl> impl;
};
std::unique_ptr<BlobstoreClient> new_blobstore_client();

View File

@ -13,7 +13,7 @@ namespace blobstore {
//
// In reality the implementation of BlobstoreClient could be a large complex C++
// library.
class BlobstoreClient::impl {
class BlobstoreClient::Impl {
friend BlobstoreClient;
using Blob = struct {
std::string data;
@ -22,7 +22,7 @@ class BlobstoreClient::impl {
std::unordered_map<uint64_t, Blob> blobs;
};
BlobstoreClient::BlobstoreClient() : impl(new typename BlobstoreClient::impl) {}
BlobstoreClient::BlobstoreClient() : impl(new BlobstoreClient::Impl) {}
// Upload a new blob and return a blobid that serves as a handle to the blob.
uint64_t BlobstoreClient::put(MultiBuf &buf) const {