コード例 #1
0
ファイル: mru.cpp プロジェクト: Gpower2/Aegisub
std::string const& MRUManager::GetEntry(std::string const& key, const size_t entry) {
	const MRUManager::MRUListMap *const map = Get(key);

	if (entry >= map->size())
		throw MRUErrorIndexOutOfRange("Requested element index is out of range.");

	return *next(map->begin(), entry);
}
コード例 #2
0
ファイル: mru.cpp プロジェクト: jeeb/aegisub
std::string const& MRUManager::GetEntry(const std::string &key, size_t entry) {
	const MRUManager::MRUListMap *map = Get(key);

	if (entry > map->size())
		throw MRUErrorIndexOutOfRange("Requested element index is out of range.");

	MRUListMap::const_iterator index = map->begin();
	advance(index, entry);
	return *index;
}