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
 1837: Create Implementation omits namespace
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Frunobulax
Ketchup Master

84 Posts

Posted - Jan 24 2011 :  06:01:48 AM  Show Profile  Reply with Quote
Consider the following code:

#include <list>

namespace foo {

    class FooMember {
    public:
        long member;
    };

    class BarMember {
    public:
        std::list<FooMember> doSomething();

        FooMember doSomethingDifferent();
    };
}


Create Implementation for doSomething() will create the following code:


std::list<FooMember> foo::BarMember::doSomething()
{

}


If the implementation is outside of the header (in a cpp file), this will not compile due to the missing namespace foo in the return value.

doSomethingDifferent() is encapsulated correctly though, so the problem occurs only if the return value is a template typed to a namespace member.

I realize that some developers will put a "using namespace foo" in the namespace, however, in large projects with many namespace it is strongly discouraged to use "using namespace".

F.

"The nice part about being a pessimist
is that you are constantly being either
proven right or pleasantly surprised."
(George F. Will)

Edited by - Frunobulax on Jan 24 2011 06:03:08 AM

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Jan 25 2011 :  12:59:11 PM  Show Profile  Reply with Quote
I am seeing the same effect here. Thank you for the clear description.

case=26956

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

sean
Whole Tomato Software

USA
2817 Posts

Posted - Mar 16 2016 :  12:13:38 AM  Show Profile  Reply with Quote
case=26956 is fixed in build 2093
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