Community
Participate
Working Groups
Sometimes when you change the code you can decide to make some certain class templated i.e. class A {}; becomes template<typename T> class A{}; In such cases if you have all funcs' implementations in a.cpp file you need to manually move the implementation to header which could be annoying if you have many functions. The same is true for constexpr functions. It would be good to see some automatic function which moves (or maybe copies for safety) implementation from source to header. Little example: 1) We have two files =====A.HPP===== // ifdefs, includes, etc. class A { public: void foo(); }; // ... =============== =====A.CPP===== // idefs, includes, etc. void A::foo() { // Do something } =============== 2) Then we use Eclipse Refactoring somehow like 'Refactor => Move implementation to header' and get changed header file: =====A.HPP===== class A { public: void foo() { // Do something } }; a.cpp could be left unchanged (for safety) or deleted. Additional information of possible implementation conditions: 1) We should have 'Preview' button. 2) It would be very nice if function order and entire header file structure won't be changed (sorted, formatted, etc.) 3) It should work both with class members and free functions. 4) We should be able to choose which functions to move (for example I want to move only 1 of 5 functions which I made a constexpr. In this case cpp file shouldn't be deleted or unchanged after operation. It still should has 4 functions.
I think the "Toggle Function" refactoring already does something similar. Have you tried it out?
(In reply to Marc-André Laperle from comment #1) > I think the "Toggle Function" refactoring already does something similar. > Have you tried it out? This is exactly what I need, thanks. But I interested is there exist any way to run it multiply times for multiply functions? The user still should to press 'Shift + Alt + T' multiply times for every function even if he selects multiply functions in editor. I still want to request the feature to have a way to do it once for multiply functions. As possible gui solutions it should be done via selecting all the functions in the editor and/or via some window with checkboxes where you can check necessary functions to toggle. I'll rename this FR, but let me know if I should create a new Feature request for such feature.
(In reply to soman namos from comment #2) > (In reply to Marc-André Laperle from comment #1) > > I think the "Toggle Function" refactoring already does something similar. > > Have you tried it out? > > This is exactly what I need, thanks. But I interested is there exist any way > to run it multiply times for multiply functions? Not currently, no. > I'll rename this FR, but let me know if I should create a new Feature > request for such feature. I think we can keep this one, with the title updated it's pretty clear. Thanks!