serialize std::variant#1344
Conversation
|
CMAKE-FORMAT TEST - PASSED |
|
CLANG-FORMAT TEST - FAILED (on last commit): |
ea8120e to
beaeece
Compare
|
CLANG-FORMAT TEST - PASSED |
|
CMAKE-FORMAT TEST - PASSED |
|
Status Flag 'Pre-Test Inspection' - - This Pull Request Requires Inspection... The code must be inspected by a member of the Team before Testing/Merging |
template <typename... Types>
template <size_t... INDEX>
constexpr void (*serialize_impl<std::variant<Types...>>::set_index<std::index_sequence<INDEX...>>[])(
std::variant<Types...>&) { [](std::variant<Types...>& obj) { obj.template emplace<INDEX>(); }... };In case the code is too hard to understand, here's a dissection:template <typename... Types>The outer template parameter list. template <size_t... INDEX>The inner template parameter list. constexprThe void (* [])( std::variant<Types...>&)
serialize_impl<std::variant<Types...>>::set_index<std::index_sequence<INDEX...>> A partial specialization of the This specialization is declared as an unspecified-size array of pointers to functions taking {
[](std::variant<Types...>& obj) { obj.template emplace<INDEX>(); }
...
};An initialization list for the unspecified-size array of function pointers, which gets expanded for each element of the Each element of the list is a lambda expression with no captures which takes a The lambda function calls the Passing the The |
feldergast
left a comment
There was a problem hiding this comment.
Thanks for the comments. I mostly understand what's going on and am willing to take the rest on faith. Can you add those comments to the appropriate places in the code so that we have it in the future when someone needs to understand the code.
|
CLANG-FORMAT TEST - PASSED |
|
CMAKE-FORMAT TEST - PASSED |
|
I have added a long comment at the end of the file explaining what the table
I have also reformatted the code in a |
|
Status Flag 'Pre-Test Inspection' - SUCCESS: The last commit to this Pull Request has been INSPECTED by label AT: PRE-TEST INSPECTED! Autotester is Removing Label; this inspection will remain valid until a new commit to source branch is performed. |
|
Status Flag 'Pull Request AutoTester' - Testing Jenkins Projects: Pull Request Auto Testing STARTING (click to expand)Build InformationTest Name: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.6_sst-elements
Build InformationTest Name: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.6_sst-elements_MR-2
Build InformationTest Name: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.6_sst-elements_MT-2
Build InformationTest Name: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.6_sst-core_Make-Dist
Build InformationTest Name: SST__AutotestGen2_NewFW_OSX-14-XC15-ARM2_OMPI-4.1.6_PY3.10_sst-elements
Using Repos:
Pull Request Author: leekillough |
|
Status Flag 'Pull Request AutoTester' - Jenkins Testing: all Jobs PASSED Pull Request Auto Testing has PASSED (click to expand)Build InformationTest Name: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.6_sst-elements
Build InformationTest Name: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.6_sst-elements_MR-2
Build InformationTest Name: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.6_sst-elements_MT-2
Build InformationTest Name: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.6_sst-core_Make-Dist
Build InformationTest Name: SST__AutotestGen2_NewFW_OSX-14-XC15-ARM2_OMPI-4.1.6_PY3.10_sst-elements
|
|
Status Flag 'Pre-Merge Inspection' - SUCCESS: The last commit to this Pull Request has been INSPECTED AND APPROVED by [ feldergast ]! |
|
Status Flag 'Pull Request AutoTester' - Pull Request MUST BE MERGED MANUALLY BY Project Team - This Repo does not support Automerge |
This adds serialization of
std::variant.