Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
flatbuffers
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
flatbuffers
Commits
5fd0fefa
Commit
5fd0fefa
authored
Dec 22, 2016
by
Wouter van Oortmerssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed empty structs generating illegal constructor in C++.
Change-Id: I60418d597b497c3cfa655ad76b3128351e9139f2
parent
b9efbf6a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
idl_gen_cpp.cpp
src/idl_gen_cpp.cpp
+2
-1
No files found.
src/idl_gen_cpp.cpp
View file @
5fd0fefa
...
...
@@ -1354,6 +1354,7 @@ class CppGenerator : public BaseGenerator {
code
+=
struct_def
.
name
+
")); }
\n
"
;
// Generate a constructor that takes all fields as arguments.
if
(
struct_def
.
fields
.
vec
.
size
())
{
code
+=
" "
+
struct_def
.
name
+
"("
;
for
(
auto
it
=
struct_def
.
fields
.
vec
.
begin
();
it
!=
struct_def
.
fields
.
vec
.
end
();
++
it
)
{
...
...
@@ -1378,7 +1379,6 @@ class CppGenerator : public BaseGenerator {
}
GenPadding
(
field
,
code
,
padding_id
,
PaddingInitializer
);
}
code
+=
" {"
;
padding_id
=
0
;
for
(
auto
it
=
struct_def
.
fields
.
vec
.
begin
();
...
...
@@ -1387,6 +1387,7 @@ class CppGenerator : public BaseGenerator {
GenPadding
(
field
,
code
,
padding_id
,
PaddingDeclaration
);
}
code
+=
" }
\n\n
"
;
}
// Generate accessor methods of the form:
// type name() const { return flatbuffers::EndianScalar(name_); }
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment