Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 1837: Create Implementation omits namespace

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
Frunobulax Posted - Jan 24 2011 : 06:01:48 AM
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.
2   L A T E S T    R E P L I E S    (Newest First)
sean Posted - Mar 16 2016 : 12:13:38 AM
case=26956 is fixed in build 2093
feline Posted - Jan 25 2011 : 12:59:11 PM
I am seeing the same effect here. Thank you for the clear description.

case=26956

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