No operator "==" matches these operands (Snake game) :     #include <vector>
    #include <limits>
    #include <algorithm>




    #include <SFML/Graphics.hpp>
    #include <iostream>
    sf::RectangleShape snake;
      //increases size of the snake
      sf::RectangleShape addsnake(){
	
	sf::RectangleShape addsnake1;
	addsnake1.setSize(sf::Vector2f(20, 25));
	addsnake1.setFillColor(sf::Color::Red);
	addsnake1.setPosition(100, 100);
	sf::RectangleShape addsnake2;
	addsnake2.setSize(sf::Vector2f(20, 30));
	addsnake2.setFillColor(sf::Color::Red);
	addsnake2.setPosition(100, 100);
	sf::RectangleShape addsnake3;
	addsnake3.setFillColor(sf::Color::Red);
	addsnake3.setSize(sf::Vector2f(20, 35));
	addsnake3.setPosition(100, 100);
	sf::RectangleShape addsnake4;
	addsnake4.setSize(sf::Vector2f(20, 40));
	addsnake4.setFillColor(sf::Color::Red);
	addsnake4.setPosition(100, 100);
	sf::RectangleShape addsnakey[4] = { addsnake1, addsnake2, addsnake3, addsnake4 };
	if (snake == snake) //problem here (No operator "==" matches these operands)

		return addsnakey[0];
	else if (snake == addsnakey[0])
		return addsnakey[1];
	else if (snake == addsnakey[1])
		return addsnakey[2];
	else if (snake == addsnakey[2])
		return addsnakey[3];
	else if (snake == addsnakey[3])
		return addsnakey[4];

        }
        //checks if snake ate the fruit
    bool intersects(const sf::RectangleShape & r1, const sf::RectangleShape & r2){
	sf::FloatRect snake = r1.getGlobalBounds();
	sf::FloatRect spawnedFruit = r2.getGlobalBounds();
	return snake.intersects(spawnedFruit);

    }

    sf::RectangleShape generateFruit() {


	sf::RectangleShape fruit;
	fruit.setFillColor(sf::Color::Yellow);
	int fruitx = rand() % 400;
	int fruity = rand() % 400;
	fruit.setPosition(fruitx, fruity);
	fruit.setSize(sf::Vector2f(5, 5));

	return fruit;


    }
    int main()
    {
	    srand(time(NULL));
	    int width = 400;
	int height = 400;
	sf::VideoMode videomode(width, height);
	sf::RenderWindow window(videomode, "Snake");
	

	snake.setFillColor(sf::Color::Red);
	snake.setSize(sf::Vector2f(20, 20));
	snake.setPosition(100, 100);
	sf::Clock clock;
	sf::Time t1 = sf::seconds(20);
	sf::RectangleShape spawnedFruit;
	while (window.isOpen()) {
		window.clear();
		window.draw(snake);



		sf::Time elapsed1 = clock.getElapsedTime();
		if (elapsed1 >= t1) {


			spawnedFruit = generateFruit();

			clock.restart();

		}

		window.draw(spawnedFruit);

		window.display();
		sf::Event event;
		while (window.pollEvent(event))
		{
			if ((event.type == sf::Event::Closed) ||
				((event.type == sf::Event::KeyPressed) && (event.key.code == sf::Keyboard::Escape)))
				window.close();
		}


	//motion
	if (sf::Keyboard::isKeyPressed(sf::Keyboard::Up))

			snake.move(0, -0.1);
		else if (sf::Keyboard::isKeyPressed(sf::Keyboard::Down))
			snake.move(0, 0.1);
		else if (sf::Keyboard::isKeyPressed(sf::Keyboard::Left))
			snake.move(-0.1, 0);
		else if (sf::Keyboard::isKeyPressed(sf::Keyboard::Right))
			snake.move(0.1, 0);
		if (intersects(snake, spawnedFruit))
		
			snake = addsnake();







	    }

    }
The error:-
No operator "==" matches these operands.Operand types are sf::RectangleShape == sf::RectangleShape. Why is that? Could you please help me fix it? I've done my research but didn't find anything relevant to my problem here. Thank you!