/*stl_list.h文件中*/
 
 
iterator insert(iterator position, const T& x) {
	link_type tmp = create_node(x);

	tmp->next = position.node;
	tmp->prev = position.node->prev;

	(link_type(position.node->prev))->next = tmp;
	position.node->prev = tmp;

	return tmp;
}
 
 
 
void push_front(const T& x) { insert(begin(), x); }
void push_back(const T& x) { insert(end(), x); }

 
 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-12
  • 2021-04-14
  • 2022-12-23
  • 2022-12-23
  • 2021-08-16
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-25
相关资源
相似解决方案