Home » U++ Library support » U++ Core » Moveable classes with virtual functions/Documentation error
Re: Moveable classes with virtual functions/Documentation error [message #2551 is a reply to message #2527] |
Mon, 17 April 2006 19:03   |
 |
mirek
Messages: 14267 Registered: November 2005
|
Ultimate Member |
|
|
hans wrote on Sun, 16 April 2006 17:05 | Hi,
documentation states in srcdoc/Core/Moveable:
All of the following requirements should be fullfilled for moveable types:
- It does not have any virtual method nor virtual base class.
This is imho incorrect, as U++ itself uses moveable classes with virtual methods, e.g. class Value.
Don't know what's the case with virtual base classes
|
First of all, no, Value does not have virtual methods (it stores a pointer to heap object with virtual methods, but that is something else).
Second, technically, it is true that there are no technical reasons for "normal" C++ implementation why polymorphic classes should not be moveable (while virtual base classes are not quite often AFAIK).
However, whole Moveable concept is walking on the thin ice. In practice, you really need just concrete types to be moveable; therefore virtual methods are not required. By excluding them, we might be makeing that ice little bit less thin, makeing "moveable" types closer to PODs, with no real disadvantage.
Mirek
|
|
|
Goto Forum:
Current Time: Mon Aug 25 03:35:21 CEST 2025
Total time taken to generate the page: 0.05356 seconds
|