[Dune] [#622] Semantics of Conversion

Dune dune at dune-project.org
Tue Oct 6 18:01:05 CEST 2009


THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

A new Flyspray task has been opened.  Details are below. 

User who did this - Martin Nolte (nolte) 

Attached to Project - Dune
Summary - Semantics of Conversion
Task Type - Support Request
Category - Common
Status - New
Assigned To - 
Operating System - Unspecified / All
Severity - Low
Priority - Normal
Reported Version - SVN
Due in Version - Undecided
Due Date - Undecided
Details - What is the exact semantics of Conversion< From, To > in typetraits.hh?

Problem: In the current implementation, class From needs a copy constructor (unless From = To) and hence may not be pure virtual.

Possible semantics:
1) Conversion::exists == true, iff a static_cast will succeed
2) Conversion::exists == true, iff To is a base class of From

ad 1) In this case, the constructor From( const To & ), but the check should not fail if it does not exist. In the current implementation From also needs a copy constructor (which could be fixed by 'static From &makeFrom()'). Moreover, the specialization of Conversion< T, T > is wrong, since it returns true, even if the copy constructor is private.

ad 2) In this case, the copy constructors need not exist and we really should check if a reference can be converted, i.e., 'static Small test( To & )' and 'static From &makeFrom()'.

P.S.: In both suggested fixes, we need to assure that From and To respectively are no reference types.

More information can be found at the following URL:
http://www.dune-project.org/flyspray/index.php?do=details&task_id=622

You are receiving this message because you have requested it from the Flyspray bugtracking system.  If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.




More information about the Dune mailing list