PDA

View Full Version : Many Data Memebers For a Class



MIH1406
22nd September 2009, 17:40
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.

caduel
22nd September 2009, 19: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

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