Title
Deducing type template arguments from default function arguments
Status
nad
Section
13.10.4 [temp.over]
Submitter
Dave Abrahams

Created on 2009-07-27.00:00:00 last changed 131 months ago

Messages

Date: 2014-02-15.00:00:00

Rationale (February, 2014):

EWG determined that no action should be taken on this issue.

Date: 2022-11-20.07:54:16

It would be useful to be able to deduce the type of a function template argument from a corresponding default function argument expression, for example:

    template <class T> int f(T = 0);
    int x = f();

A more realistic use case would be

    template <class T, class U>
    int f(T x, U y = pair<T, T>());

Ideally one would also like

    template <class T, class U>
    int f(T x, U y = g(x));

These capabilities are part of the Boost parameter library, so there should not be issues of implementability.

History
Date User Action Args
2014-03-03 00:00:00adminsetmessages: + msg4984
2014-03-03 00:00:00adminsetstatus: extension -> nad
2009-11-08 00:00:00adminsetstatus: open -> extension
2009-07-27 00:00:00admincreate