VC|++ 2005
От: Шахтер Интернет  
Дата: 08.10.05 17:23
Оценка:
Поставил себе бету. Сразу напоролся на два бага.


/* test1.cpp */ 

#include <iostream>

using namespace std;

/* Bug1 */ 

class A {};

class B : A
 {
 };

class C : public B
 {
  public:
  
   class I : A {};
 };

.\test1.cpp(19) : error C2247: 'A' not accessible because 'B' uses 'private' to inherit from 'A'
        .\test1.cpp(9) : see declaration of 'A'
        .\test1.cpp(11) : see declaration of 'B'
        .\test1.cpp(9) : see declaration of 'A'

 
/* Bug2 */  

template <class T>
struct Foo
 {
 };
 
template <size_t N> 
struct Foo<const char[N]>
 {
  enum { Ret=100 };
 };
 
template <class T,size_t N> 
struct Foo<const T[N]>
 {
 };
 
template <class T> 
int GetFoo(const T &)
 {
  return Foo<T>::Ret;
 }

/* main() */ 

int main()
 {
  cout << GetFoo("12345") << endl ;
 
  return 0;
 }
 
.\test1.cpp(43) : error C2752: 'Foo<T>' : more than one partial specialization matches the template argument list
        with
        [
            T=const char [6]
        ]
        .\test1.cpp(38): could be 'Foo<const T[N]>'
        .\test1.cpp(33): or 'Foo<const char [N]>'
        .\test1.cpp(50) : see reference to function template instantiation 'int GetFoo<const char[6]>(T (&))' being compiled
        with
        [
            T=const char [6]
        ]
В XXI век с CCore.
Копай Нео, копай -- летать научишься. © Matrix. Парадоксы
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.