c++ - Expression cannot be used as a function in constructor -
i have weird error in constructor of class.
#include "contratexception.h" //#include "file.h" namespace labpilefile { template<typename t> file<t>::file(const int max) : m_tete(0), m_queue(0), m_taillemax(max), m_cardinalite(0) { m_tab = new t[m_taillemax]; } template<typename u> std::ostream& operator <<(std::ostream& p_out, const file<u>& p_source) { p_out << "["; (int = 0; < p_source.taille(); ++i) { p_out << p_source[i] << ","; } p_out << "]"; return p_out; } } eclipse gives me several "expression cannot used function" errors 
all 3 errors same thing.
here .h, if can (i have create .cpp .h given)
#ifndef _file_h #define _file_h #include <iostream> #include <stdexcept> namespace labpilefile { template<typename t> class file { public: file(const int = max_file); ~file(); file(const file<t> &); const file<t> & operator =(const file<t> &); void enfiler(const t &); t defiler(); int taille() const; bool estvide() const; bool estpleine() const; const t & premier() const; const t & dernier() const; t operator [](const int &) const; void verifieinvariant() const; private: t *m_tab; /*!< content of queue*/ int m_tete; /*!< head of queue (first index)*/ int m_queue; /*!< last index of queue*/ int m_taillemax; /*!< current capacity of queue*/ int m_cardinalite; /*!< number of elements*/ static const int max_file = 100; /*!< default capacity*/ }; } #include "file.hpp" #endif does know i'm doing wrong?
Comments
Post a Comment