ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> boost
boost
[boost] Re: [math constants] VC++ experts needed :)
by Daniel Frey other posts by this author
Mar 11 2004 7:52AM messages near this date
Re: [boost] Re: [math constants] VC++ experts needed :) | [boost] Re: [math constants] VC++ experts needed :)
Bronek Kozicki wrote:
>  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

Yes, the code is invalid. The correct code (used in the constant 
library) looks like this:

template<template <typename>  class T>
void f( const B<T> & ) {}

T is than deduced to V. V is not a valid class on itself, it's just a 
valid template for a template template parameter. However:

>  .... however it compiles under VC71, and the output of this program is:
>  class V
>  
>  I think that's a surprise?

Nope. My skills in guessing VC-bugs just seem to get better every day :) 
Could you ask on some MS-support-groups about this, please? I think it's 
wrong to compile the code and deduce T to V, as V is not a class. The 
MS-folks should please either confirm the bug or kindly point me to the 
standard text that allows this behaviour.

Regards, Daniel


_______________________________________________
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved