Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Superfluous namespace detail with using 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
blloyd Posted - Oct 02 2014 : 5:51:00 PM
Suppose I have a header file bar.h:


namespace foo 
{

class bar
{
  public:
  bar();
  void someNewMethod();
};

} // namespace foo


And an implementation file bar.cpp:


#include "bar.h"
using namespace foo;

bar::bar() {}


When I select "Create Implementation" for bar::someNewMethod() the following lines are added to bar.cpp:


void foo::bar::someNewMethod()
{

}


But the "foo::" detail on "foo::bar::someNewMethod()" is unnecessary. One aggravating side effect of this is that when I list the methods in the file, all the foo::bar:: methods get segregated from the bar:: methods.

And it isn't just "Create implementation" that does this. If use "Change signature" on a bar:: method it gets transformed into a foo::bar:: method. If I do "Extract method" I get a foo::bar:: method. The expected result is that the "foo::" gets left oft because of the "using namespace foo" statement at the top of the file.
2   L A T E S T    R E P L I E S    (Newest First)
ChrisG Posted - Jun 18 2020 : 01:35:31 AM
case=20637 is fixed in build 2380.
https://support.wholetomato.com/default.asp?W404#2380
feline Posted - Oct 05 2014 : 12:30:40 PM
Thank you for the very clear problem description, I am seeing the same thing here, in all of the cases you are describing:

case=85429

That should not be happening, apologies for this. As a temporary work around, for the Alt-M list, can you try opening the Alt-M list, and then right clicking into the list its self, not the context field at the top of the list, and turning Off "Include Scope", this should help, since it will remove both the class name and namespace from the entries in the alt-m list.

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