Language: C++

#include <iostream>
#include <string>
#include <deque>
#include <map>
using namespace std;
typedef struct{int sx, sy, ex, ey; string to;} LINK;	//ボタンの左上・右下座標、リンク先のページ名
typedef struct{string name; int n; LINK btn[100];} PAGE;	//ページ名、ページ上にあるボタンの数・その一覧
int main()
{
	int n, o, W, H;	//ページの数、命令の数、ページの幅・高さ
	int i, j, x, y, cur, t, m;	//ループ用変数、"click x y"のx,y、、一時的な、履歴の長さ
	string op;	//命令の名前
	PAGE pg[100];
	LINK tmp;
	map<string, int> tbl;
	while (cin >> n, n)
	{
		deque<string> his;	//ページの履歴（pg[i]のiを代入）
		deque<string>::iterator itr;
		cin >> W >> H;
		for (i = 0; i < n; i++)
		{
			cin >> pg[i].name >> pg[i].n;
			tbl.insert( map<string, int>::value_type(pg[i].name, i) );
			for (j = 0; j < pg[i].n; j++)
			{
				cin >> tmp.sx >> tmp.sy >> tmp.ex >> tmp.ey >> tmp.to;
				pg[i].btn[j] = tmp;
			}
		}
		cin >> o;
		his.push_back(pg[0].name);
		cur = 0;
		m = 1;
		for (i = 0; i < o; i++)
		{
			cin >> op;
			if (op == "click")
			{
				cin >> x >> y;
				t = tbl[his.at(cur)];
				for (j = 0; j < pg[t].n; j++)
				{
					if (pg[t].btn[j].sx <= x && x <= pg[t].btn[j].ex && pg[t].btn[j].sy <= y && y <= pg[t].btn[j].ey)
					{
						his.push_back(pg[t].btn[j].to);
						cur++;
						m++;
						break;
					}
				}
				itr = his.end();
				for (j = cur+1; j < m; j++)
				{
					his.erase(*itr);
					m--;
					*itr--;
				}
			}
			else if (op == "back")
			{
				if (cur > 0)
					cur--;
			}
			else if (op == "forward")
			{
				if (cur < m)
					cur++;
			}
			else if (op == "show")
			{
				cout << his.at(cur) << endl;
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:50: error: no matching function for call to 'std::deque<std::__cxx11::basic_string<char> >::erase(std::__cxx11::basic_string<char>&)'
   55 |                                         his.erase(*itr);
      |                                         ~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/deque:66,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_deque.h:1775:7: note: candidate: 'std::deque<_Tp, _Alloc>::iterator std::deque<_Tp, _Alloc>::erase(const_iterator) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; iterator = std::_Deque_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char> > >::iterator; const_iterator = std::_Deque_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char> > >::const_iterator]'
 1775 |       erase(const_iterator __position)
      |       ^~~~~
/usr/include/c++/14/bits/stl_deque.h:1775:28: note:   no known conversion for argument 1 from 'std::__cxx11::basic_string<char>' to 'std::deque<std::__cxx11::basic_string<char> >::const_iterator' {aka 'std::_Deque_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char> > >::const_iterator'}
 1775 |       erase(const_iterator __position)
      |             ~~~~~~~~~~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_deque.h:1799:7: note: candidate: 'std::deque<_Tp, _Alloc>::iterator std::deque<_Tp, _Alloc>::erase(const_iterator, const_iterator) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; iterator = std::_Deque_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char> > >::iterator; const_iterator = std::_Deque_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char> > >::const_iterator]'
 1799 |       erase(const_iterator __first, const_iterator __last)
      |       ^~~~~
/usr/include/c++/14/bits/stl_deque.h:1799:7: note:   candidate expects 2 arguments, 1 provided
a.cc:57:45: warning: ignoring return value of 'std::_Deque_iterator<_Tp, _Ref, _Ptr>::reference std::_Deque_iterator<_Tp, _Ref, _Ptr>::operator*() const [with _Tp = std::__cxx11::basic_string<char>; _Ref = std::__cxx11::basic_string<char>&; _Ptr = std::__cxx11::basic_string<char>*; reference = std::__cxx11::basic_string<char>&]', declared with attribute 'nodiscard' [-Wunused-result]
   57 |                                         *itr--;
      |                                             ^~
/usr/include/c++/14/bits/stl_deque.h:181:7: note: declared here
  181 |       operator*() const _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~