Author |
Topic |
|
MrDoomMaster
Tomato Guru
251 Posts |
Posted - Oct 28 2015 : 08:53:24 AM
|
In C++ you should use forward slashes, like so:
#include "Subdir/MyHeader.hpp"
Instead, "Add Include" feature is adding it like this:
#include "Subdir\\MyHeader.hpp"
This is incorrect. |
|
feline
Whole Tomato Software
United Kingdom
19020 Posts |
Posted - Oct 28 2015 : 3:56:27 PM
|
Personally I have never been quite sure which slash you were supposed to use in #include lines, partly due to coming from a Unix background. There is a setting to tell VA which slash to use, which is explained here:
http://docs.wholetomato.com/default.asp?W337
By default, VA uses the slash that you are already using in the current file, to be consistent. So the setting is most useful when there are no existing #include statements to follow. |
zen is the art of being at one with the two'ness |
|
|
MrDoomMaster
Tomato Guru
251 Posts |
|
feline
Whole Tomato Software
United Kingdom
19020 Posts |
Posted - Oct 28 2015 : 6:10:53 PM
|
Interesting, learn something new every day. That is clear, but the IDE its self makes this an option in VS2010 and above. We have users who specifically want to use forward slash or back slash in their #include statements. Probably related to the main OS they are targeting. So from a support perspective, some code bases are quite set in their ways about which slash to use.
Hopefully now you have set this, VA is working as desired for you? |
zen is the art of being at one with the two'ness |
|
|
MrDoomMaster
Tomato Guru
251 Posts |
Posted - Oct 28 2015 : 6:17:28 PM
|
All toolchains support forward slash, regardless of platform. I'm under the humble opinion that by supporting backslash, the tooling is allowing "illegal" behavior.
Just because someone else is doing it wrong (i.e. VS offering the configuration, as you assert) doesn't mean you have to. Microsoft certainly does not have a reputation as standards compliant. If anyone complains about the lack of configurability, you can simply mention that forward slash is the way to do it.
Those that argue for backslash will be uneducated on these details we've covered. Most will assume since you're on Windows, include directives must also use back slashes. It's a common misconception.
Regardless, it wasn't my goal to come here to ask for features to be removed. At least this is configurable, so I can choose the correct configuration for my needs. The only outstanding recommendation is that you guys use forward-slash as the default, instead of backslash. That is arguably the most important issue here -- you certainly don't want to teach people the wrong way. |
Edited by - MrDoomMaster on Oct 28 2015 6:20:01 PM |
|
|
feline
Whole Tomato Software
United Kingdom
19020 Posts |
Posted - Oct 29 2015 : 11:48:43 PM
|
That makes sense, I have put in a bug report for this:
case=93033
However, since we follow the IDE setting when it exists, this won't make a great deal of difference until / unless Microsoft change the default in the IDE. |
zen is the art of being at one with the two'ness |
|
|
|
Topic |
|