home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c++.moderated      Moderated discussion of C++ superhackery      33,346 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 32,638 of 33,346   
   =?windows-1252?Q?Daniel_Kr=FCgler?= to All   
   Re: template argument deduction for over   
   06 Nov 12 15:13:41   
   
   From: daniel.kruegler@googlemail.com   
      
   Am 06.11.2012 18:02, schrieb Daniel Krügler:   
   > I believe your example is ruled by [temp.deduct.call] p6:   
   >   
   > "When P is a function type, pointer to function type, or pointer to   
   > member function type:   
   > [..]   
   > — If the argument is an overload set (not containing function   
   > templates), trial argument deduction is attempted using each of the   
   > members of the set. If deduction succeeds for only one of the overload   
   > set members, that member is used as the argument value for the   
   > deduction. If deduction succeeds for more than one member of the   
   > overload set the parameter is treated as a non-deduced context."   
   >   
   > In your example both "trial deductions" succeed and this makes the   
   > situation equivalent to a non-deduced context.   
      
   I need to correct myself:  [temp.deduct.call] p6 won't match here,   
   because we have no P that is a pointer to function. The right place   
   seems to be [temp.deduct.type] p5 b5 that describes the situation where   
   we have a non-deduced context here:   
      
   "A function parameter for which argument deduction cannot be done   
   because the associated function argument is a function, or a set of   
   overloaded functions (13.4), and one or more of the following apply:   
   — more than one function matches the function parameter type (resulting   
   in an ambiguous deduction), [..]"   
      
   This is exactly the situation I tried to explain in my first reponse: We   
   have an overload set here and both functions would match. The   
   instantiation error within the definition of the function template body   
   is irrelevant here, because it would be not in the immediate context (as   
   described in [temp.deduct] p8).   
      
   I apologize for any confusion,   
      
   Daniel Krügler   
      
      
   --   
         [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
         [ comp.lang.c++.moderated.    First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca