You ListItem is inmutable; its interface does not let changing the item. (It has only "getters" and no "setters".)
The ListItem::getStav() returns an int. A copy. An unnamed temporary variable. An r-value.
On the left side of operator= one has to have something that one can write to. Store to. Something that can then be used. An l-value. You cannot use a temporary unnamed int in following statements.
PS. Why is the vklad() a member of the List? It operates only on the function arguments. It could be a standalone function. (A standalone function can be part of the logical interface of a class.)
The compiler has no idea what the "List" is on line 13. By the time it does reach line 30, it does, but that is too late.
One has to forward declare:
1 2 3 4 5 6 7 8 9
class List; // identifier "List" means a class type
class ListItem {
// it is now ok to use identifier "List", unless its size is needed.
// Pointers and references don't need size of type.
};
class List {
};