You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Prefer spaceship operator instead of specific </> operators #509
@era-cell On the first question, yes. We only support C++20 and later. Don't worry about older versions! On ordering, the strongest it can be. I believe we should be able to implement strong ordering in this case, but maybe I'm wrong. If you give it a shot, I guess you'll find out :)
I ended up needing better comparison support for the schema compiler. Turns out doing the spaceship operator on the JSON class was not possible though. We had to go explicit. Check the linked PR for more details if you are curious
Compiler support was good. The problem is the JSON class. By definition, the JSON class represents many containers at once. i.e. it can be an object or an array depending on what the user wants, and I found it hard to get the "top-level" JSON class to agree on a specific type of ordering between these two containers. The spaceship operator was originally introduced to save boilerplate, but in this case, being explicit allows us to bridge those differences
Activity
suprith-hub commentedon Apr 27, 2024
Hi @jviotti I have questions on this:
jviotti commentedon Apr 29, 2024
@era-cell On the first question, yes. We only support C++20 and later. Don't worry about older versions! On ordering, the strongest it can be. I believe we should be able to implement strong ordering in this case, but maybe I'm wrong. If you give it a shot, I guess you'll find out :)
Support every comparison operator in the JSON class
Support every comparison operator in the JSON class
Support every comparison operator in the JSON class (#656)
jviotti commentedon May 7, 2024
I ended up needing better comparison support for the schema compiler. Turns out doing the spaceship operator on the JSON class was not possible though. We had to go explicit. Check the linked PR for more details if you are curious
suprith-hub commentedon May 10, 2024
Hey @jviotti. So, is that because of that spaceship operator cannot be supported in some compilers?? or is it versions problem
jviotti commentedon May 10, 2024
Compiler support was good. The problem is the JSON class. By definition, the JSON class represents many containers at once. i.e. it can be an object or an array depending on what the user wants, and I found it hard to get the "top-level" JSON class to agree on a specific type of ordering between these two containers. The spaceship operator was originally introduced to save boilerplate, but in this case, being explicit allows us to bridge those differences
suprith-hub commentedon May 10, 2024
So, that means spaceship operator somehow changed the ordering of attributes to make a comparison or after the comparison?
jviotti commentedon May 10, 2024
It was about strong/partial/weak ordering! Different types encapsulated in JSON had different characteristics
suprith-hub commentedon May 13, 2024
I assume partial ordering was not implementable.. i.g i.e, for all nested data types