Wireshark 5.1.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
unique_name.h
Go to the documentation of this file.
1
9
10#ifndef UNIQUE_NAME_H
11#define UNIQUE_NAME_H
12
13#include <QString>
14
24template <typename Candidate, typename IsTaken>
25QString uniqueName(Candidate candidate, IsTaken isTaken)
26{
27 for (int n = 0; ; ++n) {
28 QString name = candidate(n);
29 if (!isTaken(name))
30 return name;
31 }
32}
33
34#endif // UNIQUE_NAME_H
QString uniqueName(Candidate candidate, IsTaken isTaken)
Definition unique_name.h:25