The CTP adds a refactoring option to move a function definition from header to cpp, or vice-versa. Just right-click on the definition, choose Refactor/Move Definition Location and that’s it.
// h file
class Employee
{
public:
Employee();
int Foo(int x, int y);
};
// cpp file
Employee::Employee()
{
}
int Employee::Foo(int x, int y)
{
return 0;
}
Now your code looks like this.
class Employee
{
public:
Employee();
int Foo(int x, int y)
{
return 0;
}
};
You can do the reverse too. There seems to be a bug in this CTP though – when you move from the h to the cpp, it does not prefix the class-name, so you get this.
int Foo(int x, int y)
{
return 0;
}
I would assume that this would be fixed in the RTM.
Seemingly a minor feature, but it is convenient and once you get used to it, you’ll start to miss it when you don’t have it (when using an older version or a different IDE).
