Hi,
If I have many data members in my class how can I check if one of these data members is not used in the implementation file?
Thanks.
Printable View
Hi,
If I have many data members in my class how can I check if one of these data members is not used in the implementation file?
Thanks.
a) manually
b) compiler: rename (or remove) the member; if the code still compiles it is unused...
c) use a good ide; there should be ide's that can spot such things
Maybe you development environment provides something for this.
Else a file grep would be the obvious choice, but it is also very tedious. Maybe you can automate this. A script that generates a search script based on the class definition.
Out of this will something like the following be generated:Code:
class MyClass { int m_aNumber; char someMethod(char* string); };
Code:
grep m_aNumer /path/to/the/source grep someMethod /path/to/the/source