mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-29 22:32:02 +00:00
Merge pull request #4458 from a-maurice/master
Use flatbuffer unique_ptr instead of std's.
This commit is contained in:
@@ -284,7 +284,7 @@ struct StructDef : public Definition {
|
|||||||
size_t minalign; // What the whole object needs to be aligned to.
|
size_t minalign; // What the whole object needs to be aligned to.
|
||||||
size_t bytesize; // Size if fixed.
|
size_t bytesize; // Size if fixed.
|
||||||
|
|
||||||
std::unique_ptr<std::string> original_location;
|
flatbuffers::unique_ptr<std::string> original_location;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline bool IsStruct(const Type &type) {
|
inline bool IsStruct(const Type &type) {
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ inline void vector_emplace_back(std::vector<T> *vector, V &&data) {
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
const T& operator*() const { return ptr_; }
|
const T& operator*() const { return *ptr_; }
|
||||||
T* operator->() const { return ptr_; }
|
T* operator->() const { return ptr_; }
|
||||||
T* get() const noexcept { return ptr_; }
|
T* get() const noexcept { return ptr_; }
|
||||||
explicit operator bool() const { return ptr_ != nullptr; }
|
explicit operator bool() const { return ptr_ != nullptr; }
|
||||||
|
|||||||
@@ -1661,7 +1661,7 @@ void FlexBuffersTest() {
|
|||||||
int ints[] = { 1, 2, 3 };
|
int ints[] = { 1, 2, 3 };
|
||||||
slb2.Vector("bar", ints, 3);
|
slb2.Vector("bar", ints, 3);
|
||||||
slb2.FixedTypedVector("bar3", ints, 3);
|
slb2.FixedTypedVector("bar3", ints, 3);
|
||||||
slb.Bool("bool", true);
|
slb2.Bool("bool", true);
|
||||||
slb2.Double("foo", 100);
|
slb2.Double("foo", 100);
|
||||||
slb2.Map("mymap", [](flexbuffers::Builder& slb3) {
|
slb2.Map("mymap", [](flexbuffers::Builder& slb3) {
|
||||||
slb3.String("foo", "Fred"); // Testing key and string reuse.
|
slb3.String("foo", "Fred"); // Testing key and string reuse.
|
||||||
|
|||||||
Reference in New Issue
Block a user