What doesn't work?
What are you attempting to do?
Comparing two textures to see if they contain the same data? You should be using sf::Image for this.
Comparing two textures to see if they are the same texture object? You can use pointers/addresses:
if (sprite.getTexture() == &texture)sf::Sprite::getTexture() returns a pointer to a texture, not a texture itself (not that you can compare two texture objects anyway).
The link that Nexus posted doesn't say "provide your computer details", it is a very important post that says that you should give enough information about the problem and what actually goes wrong/doesn't work.