mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-03 04:21:13 +00:00
Moved C++ to optional_scalars2 and added some tests. (#6162)
* Moved C++ to optional_scalars2 and added some tests. Also deleted unused optional_scalars_generated.lobster * Fixed whitespece in C++ gencode & fixed BUILD file * Moved C++ onto optional_scalars2 in the .bat file Co-authored-by: Casper Neo <cneo@google.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright 2014 Google Inc. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -1650,7 +1650,7 @@ class CppGenerator : public BaseGenerator {
|
||||
const auto &type = field.value.type;
|
||||
code_.SetValue("PARAM_VALUE", GetDefaultScalarValue(field, false));
|
||||
if (field.IsScalarOptional())
|
||||
code_.SetValue("PARAM_TYPE", GenOptionalDecl(type));
|
||||
code_.SetValue("PARAM_TYPE", GenOptionalDecl(type) + " ");
|
||||
else
|
||||
code_.SetValue("PARAM_TYPE", GenTypeWire(type, " ", true));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user