Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 1538: namespace, using and scope

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
d_p_robinson Posted - Oct 09 2006 : 09:19:44 AM
VAX in VC6 appears to have a problem with namespaces where the namespace is referenced by a using statement rather than having the namespace applied as part of the class member function name.
E.g header (Namespaced.h):

namespace SomeNamespace
{
class Namespaced
{
public:
Namespaced();
virtual ~Namespaced();
void method ();
void methodA ();
};
}

Source (Namespaced.cpp):
#include "Namespaced.h"

using namespace SomeNamespace;

Namespaced::Namespaced() {}
Namespaced::~Namespaced() {}
void SomeNamespace::Namespaced::method(){}
void Namespaced::methodA(){}

Test code:
#include "Namespaced.h"

using namespace SomeNamespace;

int main(int argc, char* argv[])
{
Namespaced b;

b.method();
b.methodA();

SomeNamespace::Namespaced c;
c.methodA();

return 0;
}


In test code ALT-G on 'method' presents both header and cpp as alternatives, but ALT-G on 'methodA' goes straight to the header and will not pick up the cpp.

FSIW lists methodA as two separate list items, with and without the namespace.
3   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Oct 10 2006 : 3:36:21 PM
for new code if you use the VA refactoring "Create Implementation" this will place the namespace at the front of the member function when it inserts it into the cpp file for you.

not a complete solution, but this should help a bit
hwatson Posted - Oct 10 2006 : 12:57:07 PM
Aha! This appears to be why I've been having problems with Alt-G for so long. I am seeing the same results in my solution. Adding the namespace to the definition has fixed Alt-G in every case I've tried so far.

I'm using VC++ .NET 2003, so this is not limited to VC6.
feline Posted - Oct 09 2006 : 1:01:15 PM
I am seeing the same thing. Thank you for the clear example.

case=971

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