DocShoe
Mitglied
Benutzerprofil
Anmeldungsdatum: 02.04.2008
Beiträge: 1483
|
DocShoe Mitglied
18:06:13 09.03.2010 Titel: |
CG2007: using-direktive und Interner Compilerfehler |
Zitieren |
Hi,
folgender Code erzeugt bei mir einen
[C++ Fataler Fehler] main.cpp(82): F1004 Interner Compiler-Fehler at 0x12107a7 with base 0x1200000
(Zeilennummer stimmt nicht, habe einige Funktionen auskommentiert):
| C/C++ Code: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | #include <vector>
#include <iterator>
#include <algorithm>
template<typename T, unsigned int D, typename container_type=std::vector<T> >
class array_base
{
public:
typedef array_base<T,D> self_type;
typedef typename container_type::value_type value_type;
typedef typename container_type::iterator iterator;
typedef typename container_type::const_iterator const_iterator;
typedef typename container_type::reference reference;
typedef typename container_type::const_reference const_reference;
protected:
container_type Elements_;
unsigned int Extents_[D];
unsigned int Strides_[D];
public:
array_base()
{
std::fill( Extents_, Extents_ + D, 0 );
std::fill( Strides_, Strides_ + D, 0 );
}
virtual ~array_base()
{
}
self_type& operator=( const self_type& op )
{
if( this != &op )
{
Elements_ = op.Elements_;
std::copy( op.Extents_, op.Extents_ +D, Extents_ );
std::copy( op.Strides_, op.Strides_ +D, Strides_ );
}
return *this;
}
};
// nur Spezialisierungen erlauben
template<typename T, unsigned int D>
class array;
template<typename T>
class array<T,1> : public array_base<T,1>
{
public:
// Zuweisungsoperator des Basisklassen benutzen
using array_base<T,1>::operator=;
array()
{
}
};
int main()
{
array<int,1> arr;
}
| |
| C/C++ Code: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | #include <vector>
#include <iterator>
#include <algorithm>
template<typename T, unsigned int D, typename container_type=std::vector<T> >
class array_base
{
public:
typedef array_base<T,D> self_type;
typedef typename container_type::value_type value_type;
typedef typename container_type::iterator iterator;
typedef typename container_type::const_iterator const_iterator;
typedef typename container_type::reference reference;
typedef typename container_type::const_reference const_reference;
protected:
container_type Elements_;
unsigned int Extents_[D];
unsigned int Strides_[D];
public:
array_base()
{
std::fill( Extents_, Extents_ + D, 0 );
std::fill( Strides_, Strides_ + D, 0 );
}
virtual ~array_base()
{
}
self_type& operator=( const self_type& op )
{
if( this != &op )
{
Elements_ = op.Elements_;
std::copy( op.Extents_, op.Extents_ +D, Extents_ );
std::copy( op.Strides_, op.Strides_ +D, Strides_ );
}
return *this;
}
};
// nur Spezialisierungen erlauben
template<typename T, unsigned int D>
class array;
template<typename T>
class array<T,1> : public array_base<T,1>
{
public:
// Zuweisungsoperator des Basisklassen benutzen
using array_base<T,1>::operator=;
array()
{
}
};
int main()
{
array<int,1> arr;
}
| |
| C/C++ Code: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | #include <vector>
#include <iterator>
#include <algorithm>
template<typename T, unsigned int D, typename container_type=std::vector<T> >
class array_base
{
public:
typedef array_base<T,D> self_type;
typedef typename container_type::value_type value_type;
typedef typename container_type::iterator iterator;
typedef typename container_type::const_iterator const_iterator;
typedef typename container_type::reference reference;
typedef typename container_type::const_reference const_reference;
protected:
container_type Elements_;
unsigned int Extents_[D];
unsigned int Strides_[D];
public:
array_base()
{
std::fill( Extents_, Extents_ + D, 0 );
std::fill( Strides_, Strides_ + D, 0 );
}
virtual ~array_base()
{
}
self_type& operator=( const self_type& op )
{
if( this != &op )
{
Elements_ = op.Elements_;
std::copy( op.Extents_, op.Extents_ +D, Extents_ );
std::copy( op.Strides_, op.Strides_ +D, Strides_ );
}
return *this;
}
};
// nur Spezialisierungen erlauben
template<typename T, unsigned int D>
class array;
template<typename T>
class array<T,1> : public array_base<T,1>
{
public:
// Zuweisungsoperator des Basisklassen benutzen
using array_base<T,1>::operator=;
array()
{
}
};
int main()
{
array<int,1> arr;
}
| |
Ist das ein bekannter Compiler Bug? Hat jemand einen CG2009/CG2010 und kann prüfen, ob er dort auch auftritt? |
|
|
|