Add compare operator to code generated for c++ (#4940)

* Add operator== for c++ genated code

New "--gen-compare" option for flatc to generate compare operators. The operators are defined based on object based api types.

Inspired by issue #263.

* Improve compare operator for c++.
Thanks for the code review.

- Improve robustness against future schema extensions
- Code style
- Fix --rust generation in generate_code.sh
This commit is contained in:
Thomas
2018-09-22 01:53:59 +02:00
committed by Wouter van Oortmerssen
parent 873a60b0d8
commit 33791dc7b0
11 changed files with 384 additions and 11 deletions

View File

@@ -96,6 +96,8 @@ Additional options:
at the cost of efficiency (object allocation). Recommended only to be used
if other options are insufficient.
- `--gen-compare` : Generate operator== for object-based API types.
- `--gen-onefile` : Generate single output file (useful for C#)
- `--gen-all`: Generate not just code for the current schema files, but