Commit e80357ef authored by Jason Paryani's avatar Jason Paryani

Fix stylistic problems with DynamicStruct::as commit

parent 0e7f7116
......@@ -114,11 +114,11 @@ TEST(Any, AnyStruct) {
checkTestMessage(root.getAnyPointerField().getAs<TestAllTypes>());
checkTestMessage(root.asReader().getAnyPointerField().getAs<TestAllTypes>());
auto all_types = root.getAnyPointerField().getAs<AnyStruct>().as<TestAllTypes>();
auto all_types_reader = root.getAnyPointerField().getAs<AnyStruct>().asReader().as<TestAllTypes>();
all_types.setInt32Field(100);
EXPECT_EQ(100, all_types.getInt32Field());
EXPECT_EQ(100, all_types_reader.getInt32Field());
auto allTypes = root.getAnyPointerField().getAs<AnyStruct>().as<TestAllTypes>();
auto allTypesReader = root.getAnyPointerField().getAs<AnyStruct>().asReader().as<TestAllTypes>();
allTypes.setInt32Field(100);
EXPECT_EQ(100, allTypes.getInt32Field());
EXPECT_EQ(100, allTypesReader.getInt32Field());
EXPECT_EQ(48, root.getAnyPointerField().getAs<AnyStruct>().getDataSection().size());
EXPECT_EQ(20, root.getAnyPointerField().getAs<AnyStruct>().getPointerSection().size());
......
......@@ -437,9 +437,9 @@ public:
template <typename T>
ReaderFor<T> as() const {
// T must be a struct type.
return typename T::Reader(_reader);
}
// T must be a struct type.
private:
_::StructReader _reader;
......@@ -470,9 +470,9 @@ public:
template <typename T>
BuilderFor<T> as() {
// T must be a struct type.
return typename T::Builder(_builder);
}
// T must be a struct type.
private:
_::StructBuilder _builder;
friend class Orphanage;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment