Author |
Topic |
|
znakeeye
Tomato Guru
379 Posts |
Posted - Sep 07 2009 : 08:28:35 AM
|
Most projects out there suffer from #include-misuse. When possible, forward declarations should be used.
It would be great if VAX could parse ALL files in a project and remove unnecessary include-statements and replace them with forward declarations (if needed). Hence, all include/declare logic would be created by VAX (for the programmer to review, of course). |
|
Lio
Senior Member
25 Posts |
Posted - Sep 07 2009 : 8:13:16 PM
|
quote: Originally posted by znakeeye
Most projects out there suffer from #include-misuse. When possible, forward declarations should be used.
It would be great if VAX could parse ALL files in a project and remove unnecessary include-statements and replace them with forward declarations (if needed). Hence, all include/declare logic would be created by VAX (for the programmer to review, of course).
I'll second that 1!
Lio |
|
|
znakeeye
Tomato Guru
379 Posts |
Posted - Sep 08 2009 : 03:37:22 AM
|
Or at least underline ("misspelled") suspect include-statements... |
|
|
feline
Whole Tomato Software
United Kingdom
19014 Posts |
Posted - Sep 08 2009 : 11:27:32 AM
|
The idea of highlighting unnecessary #include statements has come up before, so it is probably worth having a look at:
case=32032
Working out that you can replace a #include with a forward declaration is a very interesting idea, but if this is done in a header file it is going to require updating some or even every .cpp file that includes this header file either directly or indirectly, so I am a little concerned about this. |
zen is the art of being at one with the two'ness |
|
|
Lio
Senior Member
25 Posts |
Posted - Sep 08 2009 : 9:14:57 PM
|
quote: Originally posted by feline
The idea of highlighting unnecessary #include statements has come up before, so it is probably worth having a look at:
case=32032
Working out that you can replace a #include with a forward declaration is a very interesting idea, but if this is done in a header file it is going to require updating some or even every .cpp file that includes this header file either directly or indirectly, so I am a little concerned about this.
It doesn't have to be done automatically (probably shouldn't be)... Just highlighting it so someone can then do it manually would be great.
Lio |
|
|
|
Topic |
|