Find neighbours of a vector
The XY class looks like it would be better as a plain struct:
struct XY
{
    short x;
    short y;
};

Then we don't need to declare a constructor, because it can be aggregate-initialised.
I'll assume that your vector is an alias for std::vector here, since there's no definition visible.
Eight of the statements to populate the vector look reasonable.  The duplicate of x+1, y-1 is probably unintended, though.
You might profitably use emplace_back rather than writing those constructors.  We could create the vector directly, with all the element values as its initializer-list:
std::vector&lt;XY&gt; neighboursOf(XY coord)
{
    auto const x = coord.x;
    auto const y = coord.y;

    return { {x-1, y-1}, {x, y-1}, {x+1, y-1},
             {x-1, y  },           {x+1, y  },
             {x-1, y+1}, {x, y+1}, {x+1, y+1} };
}

See how the formatting here helps us see that each neighbour is included exactly once?
It is possible to write a clever loop, but that's going to be harder to read and no more efficient than the straightforward code.
Note that if we have a finite grid, then we might want special behaviour at the edges.  And if we have an infinite grid, we'll suffer arithmetic overflow (Undefined Behaviour) when we reach the limits of short.