mardi 10 octobre 2017

Technique to cause compile time error if members are added to class in C++

Let's say you have some POC which contain multiple public members. You also have some classes which serialize and deserialize these objects from various sources. Are there any coding techniques, other than unit tests, which would make sure that when you add a member to the class, you update any additional code that needs to know about the added field.

i.e. I'd love a technique that would cause compile time errors until all code was updated to handle the new fields.





Aucun commentaire:

Enregistrer un commentaire