Dear God, now I remember why I do not program in C++ anymore (Go and C# all the way!). That pre-11 code looked awful. If networking was nicer, I might actually start considering recoding some of my projects in C++.
auto index = std::distance (begin(replicas),
std::find(begin(replicas), end(replicas), my_ip));
return (replicas.size() == index ? -1 : index); auto it = std::find(begin(replicas), end(replicas), my_ip);
return (end(replicas) == it ? -1 : std::distance(begin(replicas), it));
Yeah, i'll go with that.