Boost logo

Boost Users :

From: chun ping wang (cablepuff_at_[hidden])
Date: 2006-04-17 13:32:48


the thing is i have list<list<string> > examples.

template <typename T,
         template <typename ELEM,typename = std::allocator<ELEM> >
         class CONT
>
void testFunc(const CONT<CONT<T> >& container)
{

       std::find_if(container.begin(), container.end(),
        (
          bind(&CONT<T>::back(), _1) == var(targetValue)
        )
      );
}

std::vector<std::vector<std::string> > examples;

testFunc<std::string, std::vector>(examples);

since list don't have indexing i want to see if the last item in the
container is. .

However i get this error...

cannot call member function `typename _Alloc::reference std::vector<_Tp,
_Alloc>::back() [with _Tp = std::string, _Alloc =
std::allocator<std::string>]' without object



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net