跳到正文

闲话

Template Queue Header

Psq2416约 1 分钟
原文

这是 2026年2月8日 存档的第 3 版,不是当前版本。查看当前版本

文章信息与版本

文章信息

发布
2026年1月2日
收录
2026年1月17日
更新
2026年11月18日
篇幅
约 1 分钟

版本

  1. v8当前
  2. v7
  3. v6
  4. v5
更早的 4 个版本
  1. v4
  2. v3
  3. v2
  4. v1
C++
main.cpp: In function ‘int main()’:
main.cpp:7:7: error: ‘std::deque<int, std::allocator<int> > std::queue<int>::c’ is protected within this context
    7 |     q.c.push_back(1);
      |       ^
In file included from /usr/include/c++/13/queue:66,
                 from main.cpp:1:
/usr/include/c++/13/bits/stl_queue.h:153:17: note: declared protected here
  153 |       _Sequence c;
      |                 ^

tqh,tqh,模板队列 tqh,BFS 用 tqh,拓扑排序 tqh,单调队列 tqh,Dijk tqh,SPFA tqh,Prim tqh……