-
Notifications
You must be signed in to change notification settings - Fork 791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Tuple Name Differences in XML/JSON #143
Conversation
User rggjan requested that tuples provide a different name for each element in this issue: #140. This fix modifies tuple.hpp to generate tuple names in the order which they are are placed in the tuple. Note that this will appear to be a countdown (tuple_element2, tuple_element1, tuple_element0) since tuples are generated in reverse order. Signed-off-by: Erich Keane <erich.keane@verizon.net>
User rggjan requested that tuples provide a different name for each element in this issue: #140. This fix modifies tuple.hpp to generate tuple names in the order which they are are placed in the tuple. Note that this will appear to be a countdown (tuple_element2, tuple_element1, tuple_element0) since tuples are generated in reverse order. Signed-off-by: Erich Keane <erich.keane@verizon.net>
I don't like allocating that string just to get the NVP name. I think we can stringify the number using templates at compile time. It'd be easier/cleaner with constexpr, but we unfortunately don't get to use that (thanks MSVC!). |
Templates: transforming run time solutions into compile time solutions through the magic of many lines of code: https://gist.github.com/AzothAmmo/4e9d145e5cce0a174b36 |
tuple names are now generated at compile time. Additionally, a breaking-change of re-ordering tuples to be from first-last rather than last-first has been included.
58d1675 now uses Azoth's example to generate compile-time names. Additionally, he mentioned wanting tuples to reverse their order in another comment, so I implemented that as well. |
Any comments or anything on this one? Should i remove the ordering change? |
Does this actually change the ordering? It looks like it is still counting down instead of counting up. Other than that it looks good - I do want to change the order to be in the natural tuple order (0, 1, 2, ...) |
It DOES reverse it. Note how I've reversed the call to apply and the ar( call. This is my test snippet:
With apply happening second, this is the output:
However, with the apply second (like in 58d1675) this is my output:
|
Right you are. My eyes glossed over the unchanged line in the diff. Will fully test and merge this into 1.1. |
Everything seems fine on Linux, I don't expect any problems on Windows. Will compile with MSVC later anyway, but closing now. |
User rggjan requested that tuples provide a different name for each
element in this issue: #140.
This fix modifies tuple.hpp to generate tuple names in the order which
they are are placed in the tuple. Note that this will appear to be a
countdown (tuple_element2, tuple_element1, tuple_element0) since tuples
are generated in reverse order.
Signed-off-by: Erich Keane erich.keane@verizon.net