[CppAD-tickets] [C++ Algorithmic Differentiation] #4: gcc 4.3 complain about ambiguous conversion

C++ Algorithmic Differentiation coin-trac at coin-or.org
Mon Mar 3 08:27:56 EST 2008


#4: gcc 4.3 complain about ambiguous conversion
------------------------+---------------------------------------------------
 Reporter:  stefan      |        Owner:  somebody
     Type:  defect      |       Status:  closed  
 Priority:  normal      |    Milestone:          
Component:  component1  |      Version:          
 Severity:  major       |   Resolution:  fixed   
 Keywords:              |  
------------------------+---------------------------------------------------
Changes (by bradbell):

  * status:  new => closed
  * resolution:  => fixed

Comment:

 It appears that g++ 4.3 cannot decide between Rule 1 and Rule 2 below
 (pages refer to the ISO/IEC 14882 standard for C++). This problem was
 fixed on 2008-03-03.

 Rule 1:
 Member functions have preference over non-member functions (which suggests
 using the template version with implicit conversion from double to
 AD<double>); see 'During name lookup in a class hierarchy, some
 ambiguities may be resolved by considering whether one member hides the
 other' from page 122 of the standard.

 Rule 2:
 Non-template functions have preference over template functions (which
 suggests using the non-template version with no implicit conversion); see
 'Note also that 13.3.3 specifies that a nontemplate function will be given
 preference over a template specialization if the two functions are
 otherwise equally good candidates for an overload match.' from page 289 of
 the standard.

-- 
Ticket URL: <https://projects.coin-or.org/CppAD/ticket/4#comment:1>
C++ Algorithmic Differentiation <http://projects.coin-or.org/CppAD>
An algorithmic differentiation library for C++ programs.



More information about the CppAD-tickets mailing list