Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Format after paste tripped by initialiser list

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
alex.korban Posted - Aug 30 2007 : 10:59:26 PM
Hi

I noticed that if I copy and paste a class definition which has a constructor with an initialiser list, the formatting gets lost.

Example:
class Test : public A
{
  Test() : 
    A()
  {
  }

  void Func()
  {
  }
};


After copying and pasting:

class Test : public A
{
  Test() : 
A()
{
}

void Func()
{
}
};


Also, if I add the keyword public:
class Test : public A
{
public:
  Test() : 
    A()
  {}

  void Func()
  {
  }
};


then after a copy-paste the formatting is broken in a different way:
class Test : public A
{
public:
  Test() :
      A()
      {}

      void Func()
      {
      }
};


This only occurs when the colon is on the same line with the constructor name, and the initialiser list itself is on the next line, but this happens to be the way I often write initialiser lists.

I'm using build 1559.

Thanks
Alex.
1   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Aug 31 2007 : 07:33:03 AM
This is actually a problem with the IDE, at least in VS2005. VA asks the IDE to format the code, rather than trying to format it its self.

Try selecting the code and triggering IDE formatting, CTRL-K + CTRL-F in VS2005 to see the effect in action.

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