Chlumsky/json-cpp-gen

Deduplicate code in object map container type

Chlumsky opened this issue · 0 comments

The source code of the following functions is exatly the same between the classes ObjectContainerType and ObjectMapContainerType:

  • generateParserFunctionBody
  • generateSerializerFunctionBody
  • generateClear
  • generateRefByKey
  • generateIterateElements

However, each class must have a different base class. I think this could be fixed with templates and if that fails, simply convert these to static in one class and expose them for the other to use.