Whole Tomato Software Support Forum
Whole Tomato Software Support Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Visual Assist X
 General Release
 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  Visit kempus's Homepage  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

74 Posts

Posted - Jul 09 2009 :  12:43:19 PM  Show Profile  Visit mwb1100's Homepage  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
Moderator

United Kingdom
10888 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
Moderator

5029 Posts

Posted - Jan 31 2010 :  1:24:41 PM  Show Profile  Visit support's Homepage  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:
Whole Tomato Software Support Forum © 2010 Whole Tomato Software, Inc Go To Top Of Page
Snitz Forums 2000