Loki-Astari / ThorsMongo

C++ MongoDB API and BSON/JSON Serialization library
GNU General Public License v3.0
316 stars 72 forks source link

Fixed issue for enum's with 8 or 9 items #58

Closed scgroot closed 4 years ago

scgroot commented 4 years ago

The current ENUM macro uses NUM_ARGS to be able to give to size of the enum. This macro prepends values below 10 with a zero, possibly resulting in 08 or 09. As values with a leading zero are interpreted as octal numbers, these values are illegal and will result in a compile error.

The result is that it is not possible to serialize enum's with 8 or 9 items.

This Pull request fixes that. The zero i kept as 00, because there where all kinds of compile errors otherwise. It's also not a problem since 00 is a valid numer. I did the change also for 01 till 07, while strictly not required. I think it looked better.

scgroot commented 4 years ago

Hmm I also had to change calls to ThorsAnvil_Template_MakeTrait

That would be an API change I guess?

Loki-Astari commented 4 years ago

Looks good. Can you add two things for me.

Let me do a couple of things and I'll have it merged this week.

scgroot commented 4 years ago

Thanks!

About the two things, do you need me to do anything more?

Loki-Astari commented 4 years ago

Sorry I had two things but removed them (but accidentally left the first sentence).

I am trying to add them my-self. 1: Trying to get https://github.com/all-contributors/all-contributors-cli to work with the project so I can add you

  1. i'll update the version/read-me and ay there is a breaking change.