When you write
deque<Tile*> search();
you aren't actually declaring a deque<Tile*>
named search
and using the default constructor. Instead, C++ interprets this as a function declaration for a function named search
that takes no parameters and returns a deque<Tile*>
. You can't call push_front
on a function, hence the error.
To fix this, either remove the ()
from the declaration of the variable, or replace them with {}
(if you're using a C++11-compliant compiler). That will cause C++ to (correctly) interpret that you want to declare a variable.
Hope this helps!