Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Add include suggests wrong header

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
jschroedl Posted - Feb 15 2013 : 6:53:10 PM
The refactoring for std::function<> offers to #include <memory> but should offer to #include <functional>.

It's interesting that if I use Goto Implementation, I am correctly taken to <functional>



Info:
VS 2012 Premium with Update 1.
VAX VA_X.dll file version 10.7.1925.0 built 2012.12.14
3   L A T E S T    R E P L I E S    (Newest First)
accord Posted - Feb 20 2013 : 3:58:15 PM
std is a namespace which is defined in several places, including <memory>. When more than one declaration file is available, VA picks one of them, maybe the first one.

I see how it can be strange from the point of view of the user, though.
When you refer to a symbol through a "chain" of symbols, it might be possible that you want to include more than one file. An example of this would be the following:

You have an object which is a pointer in a file and you refer to the class's method in an other file, something like the following:

file1.h:

extern cSomeClass* Obj;

file2.h:

class cSomeClass
{
    void Method1();
};

So if you write the following in somesource.cpp you will want to include both file1.h and file2.h:

Obj->Method1();

This can be done via using "Add Include" first over "Obj", and then over "Method1".
jschroedl Posted - Feb 19 2013 : 6:41:15 PM
Indeed, if I use Add Include on the function part, it suggests <functional>. So, I'd say the bug is the suggestion to add an include for <memory>. Why would it suggest that instead of functional or nothing at all? I read the type as std::function<>.
accord Posted - Feb 18 2013 : 8:12:22 PM
This is because it does matter if you use Add Include (or Goto) on "std" or on "function". What happens if you use "Add Include" on the "function" part?

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000