Go to the documentation of this file.
35 data_t(
size_t id = 0, std::string name =
"name")
44 std::cout <<
"_id: " <<
_id <<
" _name: " <<
_name << std::endl;
60 int main(
int argc,
char const *argv[])
65 data_t _Data[5] = {1, 2, 3, 4, 5};
68 for (
int i = 0; i < 5; ++i)
75 std::cout <<
"\n入队5个元素的size: \n"
76 << seqQ.
size() <<
' ' << linQ.
size() <<
' ' << vecQ.
size() << std::endl;
79 std::cout <<
"\nseqQ出队: \n";
83 std::cout <<
"\nlinQ出队: \n";
86 auto tmp = linQ.
front();
91 std::cout <<
"\nvecQ出队: \n";
97 std::cout <<
"\n所有元素出队后的size: \n"
98 << seqQ.
size() <<
' ' << linQ.
size() <<
' ' << vecQ.
size() << std::endl;
data_t(size_t id=0, std::string name="name")
Construct a new data t object.
size_type size() const
Returns the number of elements in the queue.
reference & front()
Returns a reference to the next element in the queue.
int main(int argc, char const *argv[])
测试队列类的基本功能
bool empty() const
Test whether container is empty.
virtual bool isEmpty() const
жӿ
bool empty() const
Test whether container is empty.
void push(const value_type &val)
Inserts a new element at the end of the queue, after its current last element.
std::string _name
std::string
virtual void enQueue(const_reference &x)
入队一个元素
void pop()
Removes the next element in the queue.
virtual value_type deQueue()
出队一个元素
virtual value_type deQueue()
出队一个元素
virtual void enQueue(const_reference &x)
入队一个元素
size_type size() const
Returns the number of elements in the queue.
size_type size() const
Returns the number of elements in the queue.