On 31 Mrz., 00:59, Oncaphillis <oncaphil...@[EMAIL PROTECTED]
> wrote:
> But this
> <snip>
>
> template<class T, int i> class Vector {
>
> };
>
> class vector_fr
> {
> template <class S, int i=56> friend class Vector;
>
> };
>
> int main() {
> Vector<char> v;
> }
>
> </snip>
>
> compiles. I guess "shall not" can always be replaced by
> "shall not but can" in the standard. Which value for
> i is taken if you instantiate Vector<T> ?.
If this compiles, the compiler is not in full std-compliance
mode ;-).
The corresponding paragraph ([temp.param]/9) is quite
clear and has not been changed in this part (It has been
extended to take the new default template arguments of
function templates into account, but that's all).
"Shall" does not give any freedom to interpret the requirement
in a relaxed form, it is strictly "binding". And I don't understand,
how gcc does come to the conclusion that your code-example
is well-formed. I have the impression that it only checks the
def-arguments-shall-not-be-repeated rule ([temp.param]/12),
which could be applied to Bharath's example, but not to yours.
Greetings from Bremen,
Daniel Krügler
--
[ See http://www.gotw.ca/resources/clcm.htm
for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]


|