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 |