Home » Developing U++ » U++ Developers corner » Refactoring Moveable
Re: Refactoring Moveable [message #60776 is a reply to message #60775] |
Sun, 08 September 2024 15:41   |
 |
mirek
Messages: 14267 Registered: November 2005
|
Ultimate Member |
|
|
Oblivion wrote on Sun, 08 September 2024 13:18Hello Mirek,
Good to be on C++17
Hovewer, this seems to break a lot of things.
For example, If I derive something from MoveableAndDeepCopyOption<T>, which is now derived from TriviallyRelocatable<T> (Say, T = Vector<T>, which was possible up until now) then I can't access the methods or members of T.
Reason: TriviallyRelocatable<T> is defined as:
template <class T>
struct TriviallyRelocatable {};
Any ideas on how to proceed, or am I missing something?
Best regards,
Oblivion
Uhm, normal use is like
struct Foo : MoveableAndDeepCopyOption<Foo> {
...
};
- obviously, you can access methods of Foo in Foo...
Example of what you need?
Note: There is one small issue I was unable to solve. U++ had two parameter Moveable, where second parameter was optional base class. It is supposed to help with MSC++ big with empty base class optimisations. It does not seem possible to use template magic with that which would go well MSC++ optimiser, putting Moveable first in the base class list seems to work fine wrt MSC++ optimisation and it really was used very sparsely even in U++ code and I guess almost never in client code.
Anyway
struct Foo : Moveable<Foo, FooBase> ...
now has to be rewritten as
struct Foo : Moveable<Foo>, FooBase ...
[Updated on: Sun, 08 September 2024 15:42] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Tue Aug 12 19:18:37 CEST 2025
Total time taken to generate the page: 0.07157 seconds
|