IteratorDemo.cpp 558 B

1234567891011121314151617181920212223242526
  1. #include "IteratorDemo.h"
  2. void testRingQueueManualMutex()
  3. {
  4. RingQueueManualMutex<int> queue(5, -1);
  5. queue.push(1);
  6. queue.push(2);
  7. queue.push(3);
  8. queue.push(4);
  9. queue.push(5);
  10. auto old = queue.push(6); // This should remove 1
  11. SPDLOG_INFO("Old value removed: {}", old);
  12. // for(auto it = queue.begin(); it != queue.end(); ++it)
  13. // {
  14. // SPDLOG_INFO("Value: {}", *it);
  15. // }
  16. for(auto it : queue)
  17. {
  18. SPDLOG_INFO("Value: {}", it);
  19. }
  20. SPDLOG_INFO("RingQueueManualMutex 测试完成");
  21. }