This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: bugreport gcc on linux



gcc 2.95.2 says:
myvectorbasis.cc: In method `myvektorbasis<T>::myvektorbasis(typename
myvektorbasis<T>::size_type, const T & = T())':
myvectorbasis.cc:18: class `myvektorbasis<T>' does not have any field
named `vector'

So the bug is fixed. I suggest you upgrade.


Note that your use of 'vector(n,value)' on line 18 is ill-formed; the
  template parameters of a class template name can only be elided in the
  declaration of the class template. 'vector<T>(n,value)' would be
  correct. 

Thank you for your bug report.

[snip]
> #include <iostream.h>
> #include <stdlib.h>
> #include <vector.h>
> 
> template<typename T = float>
> class myvektorbasis
> : public vector<T>
> {
> public:
>         myvektorbasis();
>         myvektorbasis(size_type n, const T& value = T() );
>         ~myvektorbasis();
> };
> 
> template<typename T> myvektorbasis<T>::myvektorbasis(){
> }
> 
> template<typename T> myvektorbasis<T>::myvektorbasis(size_type n, const
T& value ): vector(n,value)
> {
> 
> }
> 
> 
> template<typename T> myvektorbasis<T>::~myvektorbasis(){
> }
> 
> 
> template class myvektorbasis<double>;
> //template class myvektorbasis;
> myvektorbasis<int> ab;
> 
> int main(int argc, char *argv[])
> {
>   cout << "Hello, World!" << endl;
> 
>   return EXIT_SUCCESS;
> }
> 
[snip]  




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]