Sprawdzenie czy wprowadzono liczby może wyglądać tak:
while (!(std::cin >> value))
{
std::cin.clear();
while (std::cin.get() != '\n') {}
std::cout << "Bledne dane, podaj liczbe: ";
}
Oczywiście zmienną value zamieniasz w Twoim przypadku na Move
Kod generuje dużo ostrzeżeń (napiszę po angielsku abyś mógł łatwiej znaleźć rozwiązanie):
- redundant literal supplied to boolean operator
- do not use 'else' after 'return'
- redundant boolean literal in conditional return statement
- do not use array subscript when the index is not an integer constant expressions