Determine whether map m contains an entry with value v, for some key.
print "Found it!" if exists $m{$v};
#include <iostream> #include <unordered_map>
int main() { // simple comparison demo std::unordered_map<int,char> example = {{1,'a'},{2,'b'}}; size_t nElements = example.count(2); if (nElements) { std::cout << "Found " << nElements << " values." << '\n'; } else { std::cout << "Not found\n"; } }
using System.Collections.Generic;
_m.ContainsValue(_v)
import std.algorithm;
m.byValue.canFind(v);
m.containsValue(v);
Map.values(m) |> Enum.member?(v)
func containsValue(m map[K]T, v T) bool { for _, x := range m { if x == v { return true } } return false }
elem v (elems m)
Object.values (m).indexOf (v) !== -1
import java.util.Map;
m.containsValue(v)
in_array($v, $m, true);
uses fgl;
m.IndexOfData(v) >= 0
v in map.values()
m.value?(v)
use std::collections::BTreeMap;
let does_contain = m.values() .any(|&val| *val == v);
!m.values.find(_ == v).isEmpty()
No security, no password. Other people might choose the same nickname.