Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 1727: Add include with #pragma once (C++)
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

kempus
Junior Member

12 Posts

Posted - Jul 09 2009 :  05:12:12 AM  Show Profile  Reply with Quote
This is only a small annoyance, but when you add an include (using refactoring) in a header file, if there are no includes already, it adds it before #pragma once at the top of the file.

Thanks, Tim


#pragma once

class A
{
  CUnknown m_Member;
}


after adding include for CUnknown using VAX, you get


#include "unknown.h"
#pragma once

class A
{
  CUnknown m_Member;
}

mwb1100
Ketchup Master

82 Posts

Posted - Jul 09 2009 :  12:43:19 PM  Show Profile  Reply with Quote
This is only a cosmetic issue. The #pragma once marks the entire header (presumably a.h) to only be included that one time. If a.h is brought in by a subsequent #include in the same compilation unit, the whole thing is skipped - not just the stuff after the #pragma once.

In other words, a #pragma once anywhere in the header file is equivalent to a #pragma once at the top of the header file (except that the #pragma once can be 'disabled' with a conditional compilation directive).


So unknown.h will not be brought in twice (at least not via a.h).
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Jul 11 2009 :  2:05:51 PM  Show Profile  Reply with Quote
I can see that it would look better if the #include statement went after the #pragma once:

case=29480

In general VA is not going to know the "correct" place for the #include line, but moving it should be a lot quicker than adding it manually in the right place.

zen is the art of being at one with the two'ness
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Jan 31 2010 :  1:24:41 PM  Show Profile  Reply with Quote
case=29480 is fixed in build 1810

Whole Tomato Software, Inc.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000