Title
Can a default argument for a template parameter appear in a friend declaration?
Status
tc1
Section
13.2 [temp.param]
Submitter
unknown

Created on 1998-10-24.00:00:00 last changed 262 months ago

Messages

Date: 1999-10-15.00:00:00

Proposed resolution (10/00): Add to the end of 13.2 [temp.param] paragraph 9,

A default template-argument shall not be specified in a friend template declaration.

(See also issue 136.)

Date: 2022-11-20.07:54:16

13.2 [temp.param] paragraph 10 says:

The set of default template-arguments available for use with a template declaration or definition is obtained by merging the default arguments from the definition (if in scope) and all declarations in scope in the same way as default function arguments are (9.3.4.7 [dcl.fct.default] )."
Can a default argument for a template argument appear in a friend declaration? If so, when is this default argument considered for template instantiations?

For example,

    template<class T1, class T2 = int> class A;

    class B {
        template<class T1 = int, class T2> friend class A;
    };
Is this well-formed? If it is, should the IS say when the default argument for T1 is considered for instantiations of class A?

Proposed resolution (10/00): Add to the end of 13.2 [temp.param] paragraph 9,

A default template-argument shall not be specified in a friend template declaration.

(See also issue 136.)

History
Date User Action Args
2003-04-25 00:00:00adminsetstatus: dr -> tc1
2000-11-18 00:00:00adminsetstatus: ready -> dr
2000-05-21 00:00:00adminsetstatus: review -> ready
2000-02-23 00:00:00adminsetmessages: + msg231
2000-02-23 00:00:00adminsetstatus: open -> review
1998-10-24 00:00:00admincreate