小编Mar*_*tin的帖子

C++:与之前的声明冲突?

我正在进行这项任务,并且我继续收到一个明显先前声明的方法的错误.这是.h文件:

#ifndef DLLIST_H
#define DLLIST_H

#include <iostream>
#include <fstream>
#include <cstddef>
#include "DListNode.h"

typedef int ItemType;

class DLList
{
private:
  friend std::ostream & operator<< (std::ostream & out, DLList & other);
  int size;
  int * head;
  int * tail;

  void _copy(const DLList * toCopy);
  void _dealloc();

public:
  DLList();
  DLList(const DLList & toCopy);

  ~DLList();

  DLList & operator=(const DLList & toCopy);

  int size();
  void append(ItemType item);
  void insert(int index, ItemType item);
  ItemType pop(int index);
  ItemType pop();
  const DListNode & operator[] (int idx);

}; …
Run Code Online (Sandbox Code Playgroud)

c++ conflict declaration

4
推荐指数
1
解决办法
2万
查看次数

标签 统计

c++ ×1

conflict ×1

declaration ×1