Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
static const int MAX = 10000;
static const bool NOTV = 0;
static const bool VISIT = 1;
int v;

vector<int> G[MAX];
bool visit[MAX];
list<int> out;
void dfs(int s) {
	visit[s] = VISIT;
	for (int i = 0; i < G[s].size(); i++) {
		if (not visit[G[s][i]]) dfs(G[s][i]);
	}
	out.push_front(s);
}

void topoSort() {
	fill(visit, visit + v, NOTV);
	for (int i = 0; i < v; i++) {
		if (not visit[i]) dfs(i);
	}
}


int main() {
	int e, s, t;
	cin >> v >> e;
	for (int i = 0; i < e; i++) {
		cin >> s >> t;
		G[s].push_back(t);
	}
	topoSort();
	while (not out.empty()) {
		cout << out.front() << endl;
		out.pop_front();
	}
}

Compiler output:
a.cc: In function 'void dfs(int)':
a.cc:14:9: error: reference to 'visit' is ambiguous
   14 |         visit[s] = VISIT;
      |         ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
                 from a.cc:2:
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:11:6: note:                 'bool visit [10000]'
   11 | bool visit[MAX];
      |      ^~~~~
a.cc:16:25: error: reference to 'visit' is ambiguous
   16 |                 if (not visit[G[s][i]]) dfs(G[s][i]);
      |                         ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:11:6: note:                 'bool visit [10000]'
   11 | bool visit[MAX];
      |      ^~~~~
a.cc: In function 'void topoSort()':
a.cc:22:14: error: reference to 'visit' is ambiguous
   22 |         fill(visit, visit + v, NOTV);
      |              ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:11:6: note:                 'bool visit [10000]'
   11 | bool visit[MAX];
      |      ^~~~~
a.cc:22:21: error: reference to 'visit' is ambiguous
   22 |         fill(visit, visit + v, NOTV);
      |                     ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:11:6: note:                 'bool visit [10000]'
   11 | bool visit[MAX];
      |      ^~~~~
a.cc:24:25: error: reference to 'visit' is ambiguous
   24 |                 if (not visit[i]) dfs(i);
      |                         ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:11:6: note:                 'bool visit [10000]'
   11 | bool visit[MAX];
      |      ^~~~~