It is useful for a polymorphic_adapter to be able to insert the discrimination
key itself. This allows derived types to be unaware of whether they are being
directly serialized or if they are being generically serialized and need to
insert the discriminator key. It also simplifies the adapter code for the
derived types.
In addition to being able to insert the key, functionality was added to merely
check if the key was correctly inserted by the derived type.
The default behavior to do neither insertion nor checking has been maintained.
One has to opt-in to this new functionality.
The documentation was updated, and the unit test for polymorphic adapters was
expanded.
It is useful for a polymorphic_adapter to be able to insert the discrimination key itself. This allows derived types to be unaware of whether they are being directly serialized or if they are being generically serialized and need to insert the discriminator key. It also simplifies the adapter code for the derived types.
In addition to being able to insert the key, functionality was added to merely check if the key was correctly inserted by the derived type.
The default behavior to do neither insertion nor checking has been maintained. One has to opt-in to this new functionality.
The documentation was updated, and the unit test for polymorphic adapters was expanded.