I'm using an Optional class quite similar to that of boost. I switched an attribute of the same (structured) type in some class definitions (and therefore also in method signatures) from mandatory to optional. So, I included my Optional.h file. To ease typing, I added a typedef in each class header file.
Today I run Cppcheck 1.68 on the project and got this style warning
The typedef '[my optional type]' hides a typedef with the same name.
How can I get rid of theses style warnings without making something bad?
Remarks:
- I think of introducing a new header only for this purpose. But maybe there are better options?
- I guess that it could generally be an indication of bad design, to have many classes with the same optional attribute, but I'm not sure in my special case. The code is currently changing to reach higher prioritized goals.
Aucun commentaire:
Enregistrer un commentaire