Hacker News new | ask | show | jobs
by nly 3736 days ago
Like this?

    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.
1 comments

Yeah that's what I was thinking.