mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 04:04:19 +00:00
Removal of support for FLATBUFFERS_CPP98_STL (#6918)
* Removal of support for FLATBUFFERS_CPP98_STL For context, see https://github.com/google/flatbuffers/issues/6704 * Also removed vector_data
This commit is contained in:
committed by
GitHub
parent
3fab0c6ee4
commit
6748c373be
@@ -9,20 +9,13 @@ struct OwnedAllocator : public flatbuffers::DefaultAllocator {};
|
||||
|
||||
class TestHeapBuilder : public flatbuffers::FlatBufferBuilder {
|
||||
private:
|
||||
// clang-format off
|
||||
#if !defined(FLATBUFFERS_CPP98_STL)
|
||||
TestHeapBuilder(const TestHeapBuilder &);
|
||||
TestHeapBuilder &operator=(const TestHeapBuilder &);
|
||||
#endif // !defined(FLATBUFFERS_CPP98_STL)
|
||||
// clang-format on
|
||||
|
||||
public:
|
||||
TestHeapBuilder()
|
||||
: flatbuffers::FlatBufferBuilder(2048, new OwnedAllocator(), true) {}
|
||||
|
||||
// clang-format off
|
||||
#if !defined(FLATBUFFERS_CPP98_STL)
|
||||
// clang-format on
|
||||
TestHeapBuilder(TestHeapBuilder &&other)
|
||||
: FlatBufferBuilder(std::move(other)) {}
|
||||
|
||||
@@ -30,9 +23,6 @@ class TestHeapBuilder : public flatbuffers::FlatBufferBuilder {
|
||||
FlatBufferBuilder::operator=(std::move(other));
|
||||
return *this;
|
||||
}
|
||||
// clang-format off
|
||||
#endif // !defined(FLATBUFFERS_CPP98_STL)
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
// This class simulates flatbuffers::grpc::detail::SliceAllocatorMember
|
||||
@@ -56,18 +46,12 @@ struct GrpcLikeMessageBuilder : private AllocatorMember,
|
||||
Swap(other);
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
#if !defined(FLATBUFFERS_CPP98_STL)
|
||||
// clang-format on
|
||||
GrpcLikeMessageBuilder &operator=(GrpcLikeMessageBuilder &&other) {
|
||||
// Construct temporary and swap idiom
|
||||
GrpcLikeMessageBuilder temp(std::move(other));
|
||||
Swap(temp);
|
||||
return *this;
|
||||
}
|
||||
// clang-format off
|
||||
#endif // !defined(FLATBUFFERS_CPP98_STL)
|
||||
// clang-format on
|
||||
|
||||
void Swap(GrpcLikeMessageBuilder &other) {
|
||||
// No need to swap member_allocator_ because it's stateless.
|
||||
@@ -155,4 +139,4 @@ void FlatBufferBuilderTest() {
|
||||
}
|
||||
|
||||
// Link-time check using pointer type.
|
||||
void CheckTestGeneratedIsValid(const MyGame::Example::Color &) {}
|
||||
void CheckTestGeneratedIsValid(const MyGame::Example::Color &) {}
|
||||
|
||||
Reference in New Issue
Block a user