Hi, I have block of code in C++ like this:
++
std::vector<std::pair<int, int>> TL;
int texture, lightmap;
auto p = std::make_pair(texture, lightmap); // make pair
auto it = std::find(TL.begin(), TL.end(), p); // iterator
int pos = std::distance(TL.begin(), it); // the distance from the
first pair
if (it != texturePairs.TL.end())
{
doSomething(pos);
}
Run
Basicly, I take two ints, make pair out of them, then i search for that pair in
a vector of pairs, if the pair is found, doSomething(pos) runs.
How do i make this in Nim? I looked for pairs, but in Nim they are similar to
enumerations.
[https://forum.nim-lang.org/t/3570](https://forum.nim-lang.org/t/3570)