Hi
I'm trying to do the following.
#include <vector>
#include <boost/thread/mutex.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/tuple/tuple.hpp>
class {
boost::mutex m_lock;
std::vector<boo st::tuple<uint3 2_t, boost::shared_p tr<T >
m_vector;
template <class Tboost::shared_ ptr<Tlist::<T>g etitem(uint32_t id)
{
boost::mutex::s coped_lock lock(m_lock);
std::vector< boost::tuple<ui nt32_t, boost::shared_p tr<T
find_if(m_vecto r.begin(), m_vector.end(), compare_list<T> (id),
m_vector.begin( ));
if (pos != m_vector.end())
return *pos;
return boost::shared_p tr(NULL);
};
but I get the following error
error: expected ';' before 'pos'
I don't understand why I'm getting this error because the definition
of std::vector works, it's just the iterator statement that doesn't.
I'm trying to do the following.
#include <vector>
#include <boost/thread/mutex.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/tuple/tuple.hpp>
class {
boost::mutex m_lock;
std::vector<boo st::tuple<uint3 2_t, boost::shared_p tr<T >
m_vector;
template <class Tboost::shared_ ptr<Tlist::<T>g etitem(uint32_t id)
{
boost::mutex::s coped_lock lock(m_lock);
std::vector< boost::tuple<ui nt32_t, boost::shared_p tr<T
>::iterator pos =
m_vector.begin( ));
if (pos != m_vector.end())
return *pos;
return boost::shared_p tr(NULL);
};
but I get the following error
error: expected ';' before 'pos'
I don't understand why I'm getting this error because the definition
of std::vector works, it's just the iterator statement that doesn't.
Comment