0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-20 20:13:05 +02:00
Commit Graph

3 Commits

Author SHA1 Message Date
James Yonan
e3b0bf4f5c MSF iterator: allow conversion from ordinary iterator and added exists() method
Also added better comments for MSF::find().

Signed-off-by: James Yonan <james@openvpn.net>
2019-09-06 22:24:56 -06:00
James Yonan
eec139a100
MSF::find: renamed template type names to avoid conflict with preprocessor symbol (ITER) in test/ssl/proto.cpp
Signed-off-by: James Yonan <james@openvpn.net>
2019-05-16 14:50:06 +02:00
James Yonan
3d6b6b2319
library: added convenience method MSF::find() for maps/sets
MSF::find() is like ordinary map/set find(), but returns an
iterator that defines an operator bool() method for testing
if the iterator is defined, e.g.:

  std::map<std::string, std::string> m;
  m.emplace("hello", "world");

  auto e = MSF::find(m, "hello");
  if (e)
    std::cout << e->first << " -> " << e->second << std::endl;

Signed-off-by: James Yonan <james@openvpn.net>
2019-05-15 19:12:59 +02:00