Re: [boost] Re: [math constants] VC++ experts needed :)
by Bronek Kozicki other posts by this author
Mar 11 2004 7:10AM messages near this date
[boost] Re: [math constants] VC++ experts needed :)
|
[boost] Re: [math constants] VC++ experts needed :)
Daniel Frey <d.frey@[...].de> wrote:
[...]
I tried following code:
#include <iostream>
template <typename T> class V {};
template <template <typename> class T> struct B {};
struct D : B<V> {};
template <typename T>
void f (const B<T> &)
{
std::cout << typeid(T).name() << std::endl;
}
int main()
{
D d;
f (d);
}
According to Comeau compiler and GCC this program is invalid. I have
following error messages
(from GCC 3.3.1):
T246.cpp:6: error: type/value mismatch at argument 1 in template
parameter list
for `template<template<class> class T> struct B'
T246.cpp:6: error: expected a class template, got `T'
T246.cpp:7: error: ISO C++ forbids declaration of `parameter' with no
type
T246.cpp: In function `int main()':
T246.cpp:13: error: no matching function for call to `f(D&)'
(from Comeau online 4.3.3 beta)
"ComeauTest.c", line 6: error: template parameter "T" is not a class
template
void f (const B<T> &)
^
"ComeauTest.c", line 13: error: no instance of function template "f"
matches the
argument list
The argument types that you used are: (D)
f (d);
^
... however it compiles under VC71, and the output of this program is:
class V
I think that's a surprise?
B.
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Thread:
Thorsten Ottosen
Thorsten Ottosen
Daniel Frey
Thorsten Ottosen
Daniel Frey
Thorsten Ottosen
Daniel Frey
Thorsten Ottosen
Guillaume Melquiond
Daniel Frey
Bronek Kozicki
Bronek Kozicki
Bronek Kozicki
Daniel Frey
Bronek Kozicki
Daniel Frey
Daniel Frey
Bronek Kozicki
Daniel Frey
Daniel Frey
Bronek Kozicki
Daniel Frey
Bronek Kozicki
Bronek Kozicki
Daniel Frey
Paul A Bristow
Paul A Bristow
Paul A Bristow
Paul A Bristow
Phil Richards
Daniel Frey
Paul A Bristow
David Abrahams
Paul A Bristow
David Abrahams
|