View Full Version : Many Data Memebers For a Class

22nd September 2009, 18:40

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?


22nd September 2009, 20:54
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

22nd September 2009, 21:00
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.

class MyClass {
int m_aNumber;
char someMethod(char* string);
};Out of this will something like the following be generated:
grep m_aNumer /path/to/the/source
grep someMethod /path/to/the/source