Witam, mam taki kod:
template < typename T= typename std::enable_if< std::is_base_of<T,sf::Drawable>::value>::type >
bool drawCollection(std::vector<T> *collection);
template<typename T>
inline bool Scene::drawCollection(std::vector<T>* collection)
{
for (auto&var : collection)
var.draw();
return true;
}
gdzie każdy obiekt kolekcji z racji na użycie enable_if będzie miał metodę .draw, niestety wyskakują takie błędy:
Severity Code Description Project File Line Suppression State
Error C2065 'var': undeclared identifier
Severity Code Description Project File Line Suppression State
Error C2228 left of '.draw' must have class/struct/union
Severity Code Description Project File Line Suppression State
Error C3312 no callable 'begin' function found for type 'std::vector<mv::Cell,std::allocator<_Ty>> *'
Severity Code Description Project File Line Suppression State
Error C3312 no callable 'end' function found for type 'std::vector<mv::Cell,std::allocator<_Ty>> *'
wszystkie tyczą się tej pętli
ps: a no i niestety tę metodę dalej da się wywołać z innymi klasami...