Cool!
Here a few points you might want to think about:
Your mixing of iterating over the states and
std::find_if is flawed (afaik). You go through all states, then
std::find_if will return the first occurrence where
getDrawOverOtherStates() returns true for the given iterator till the end of the map. So if we have the following list where each digit represents the function return value: 10001100
Thus the iteration of std::find if would work like this:
1
0001
001
01
1
1
00
0
Not sure if that made sense, but what I'm trying to point out is, that you do too many iterations for nothing. You could use find_if and a while loop on its own, without having to iterate over all elements additionally.
A
std::map has a function
empty(), thus it would be more expressive to use that instead of
site() == 0.
Is a
std::shared_ptr needed? Shouldn't the state manager be the full owner of the state? If so, you might want to use
std::unique_ptr.
get/setDrawOverOthers(States) is quite a long name and the "draw" is a bit misleading since it also applies for updating and event handling. Thus you might want to find something shorter and more precise.
isStateStackEmpty "reveals" an implementation detail, although you don't really use a stack internal. You might want to use something more generic.