Я пытаюсь построить класс под названием Arraybag, и у меня проблемы с моим компилятором, который дает мне эту ошибку. < /p>
Цель класса состоит в Уметь принять большинство простых типов данных в массиве All All.//
#include
// Constructor; creates and initializes an empty Bag
template
ArrayBag::ArrayBag()
{
itemCount = 0;
}
// Return the number of Items being stored in the Bag
template
int ArrayBag::getCurrentSize() const
{
return itemCount; // STUB
}
// Return the capacity of the bag (the maximum Items it can store)
template
int ArrayBag::getCapacity( ) const
{
return DEFAULT_CAPACITY;
}
// Report whether the Bag is empty
// Return true if the Bag is empty (storing no Items);
// Return false if Items exist in the Bag
template
bool ArrayBag::isEmpty() const
{
return (itemCount == 0);
}
// Report whether the Bag is full
// Return true if the Bag is filled to capacity
// Return false if there is still room
template
bool ArrayBag::isFull() const
{
return (itemCount == DEFAULT_CAPACITY); // STUB
}
// Give the Bag a new Item to store
// If Bag is full, nothing changes
// Else, Bag must add this Item to its Item array and update its itemCount
// If Bag is full after this, return true; else return false
template
bool ArrayBag::add(const ItemType& newItem)
{
if(itemCount == DEFAULT_CAPACITY)
{
cout
Подробнее здесь: https://stackoverflow.com/questions/214 ... fore-token
Ошибка класса шаблонов "ожидаемый инициализатор до '<' token" ⇐ C++
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Token Postman JWT Token возвращает 401, несанкционированный в ASP.net Core Web API
Anonymous » » в форуме C# - 0 Ответы
- 16 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Token Postman JWT Token возвращает 401, несанкционированный в ASP.net Core Web API
Anonymous » » в форуме C# - 0 Ответы
- 16 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Token Postman JWT Token возвращает 401, несанкционированный в ASP.net Core Web API
Anonymous » » в форуме C# - 0 Ответы
- 14 Просмотры
-
Последнее сообщение Anonymous
-