C:/Users/r1821655/CLionProjects/untitled/sequence.cpp:48:5: error: return type specification for constructor invalid template class sequence { public: // TYPEDEFS and MEMBER SP2020 typedef Item value_type; typedef std::size_t size_type; static const size_type CAPACITY = 10; // CONSTRUCTOR sequence(); // MODIFICATION MEMBER FUNCTIONS void start(); void end(); void advance(); void move_back(); void add(const value_type& entry); void remove_current(); // CONSTANT MEMBER FUNCTIONS size_type size() const; bool is_item() const; value_type current() const; private: value_type data[CAPACITY]; size_type used; size_type current_index; }; } 48 | void sequence::sequence() : used(0), current_index(0) { } | ^~~~ line 47 template line 48 void sequence::sequence() : used(0), current_index(0) { }
C:/Users/r1821655/CLionProjects/untitled/sequence.cpp:48:5: error: return type specification for constructor invalid
template <class Item>
class sequence
{
public:
// TYPEDEFS and MEMBER SP2020
typedef Item value_type;
typedef std::size_t size_type;
static const size_type CAPACITY = 10;
// CONSTRUCTOR
sequence();
// MODIFICATION MEMBER FUNCTIONS
void start();
void end();
void advance();
void move_back();
void add(const value_type& entry);
void remove_current();
// CONSTANT MEMBER FUNCTIONS
size_type size() const;
bool is_item() const;
value_type current() const;
private:
value_type data[CAPACITY];
size_type used;
size_type current_index;
};
}
48 | void sequence<Item>::sequence() : used(0), current_index(0) { }
| ^~~~
line 47 template<class Item>
line 48 void sequence<Item>::sequence() : used(0), current_index(0) { }
Step by step
Solved in 2 steps