T O P I C R E V I E W |
Harald Krause |
Posted - Feb 27 2025 : 09:27:29 AM Even worse: It just deletes everything in the file where the base class is defined. |
3 L A T E S T R E P L I E S (Newest First) |
feline |
Posted - Feb 27 2025 : 2:07:51 PM Obviously first make sure your code is checked into source control!
If you trigger Move to base class again, do you get the problem a second time? I am wondering if, somehow, this was a random, one off problem. I have run several tests with all of the classes declared in the same header files, and no code is ever being deleted for me. So this isn't something that always happens.
Assuming the problem happens again, if you have the time, can you please try copying just the header file into a new, default C++ solution, and see if the same problem shows up there? I am trying to work out if the solution context is somehow a factor and a problem. If macros are a factor then this might make a difference.
But if you get the same problem in this simplified situation, would it be possible to get a copy of this test solution, really just this single header file, to try and reproduce the problem here? The code would only be used for testing purposes, but I realise this is still often not an option. Still, worth asking on the off chance.
If this is possible can you please send me the files via email:
[email protected]
including this thread ID or URL in the description, so we can match it up. |
Harald Krause |
Posted - Feb 27 2025 : 10:30:26 AM Undo restored the code. In this case no template was used. Language is C++, Visual Studio 2022
However the base class is defined in the same header file as the class like this:
class Base {
};
class UsingBaseA : public Base {
};
class UsingBaseB : public Base {
}; |
feline |
Posted - Feb 27 2025 : 10:07:53 AM Obviously very bad! Is this C++? I assume the base and child classes are in separate files.
I am not seeing any problems with this command here in some simple test cases, so could do with some help understanding your situation, and the trigger for this bug.
First things first, has Undo restored your code to how it was? This is the first thing to sort out.
Are you working with template code? A lot of macros? Is there anything "odd" about any of the classes?
|
|
|