M
Misiu
Hello everybody,
How to avoid using struct IsDataType for comparison for find_if
algorithm but use something like that what is now commented out in the
code below?
Regards,
Misiu
template<typename T>
struct IsDataType
{
bool operator() (const boost::any& operand)
{
return (operand.type() ==
typeid(boost::shared_ptr<DataDistributor<T> >));
}
};
template<typename T>
static DataDistributor<T>* GetDataDistributor()
{
std::list<boost::any>::iterator iter =
std::find_if(m_distrubutors.begin(), m_distrubutors.end(),
IsDataType<T>());
//error C2248: 'type_info::type_info' : cannot access private member
//declared in class 'type_info' boost\tuple\detail\tuple_basic.hpp 477
// std::find_if(m_distrubutors.begin(), m_distrubutors.end(),
// boost::lambda::bind(&boost::any::type, _1) ==
// typeid(boost::shared_ptr<DataDistributor<T> >));
....
}
How to avoid using struct IsDataType for comparison for find_if
algorithm but use something like that what is now commented out in the
code below?
Regards,
Misiu
template<typename T>
struct IsDataType
{
bool operator() (const boost::any& operand)
{
return (operand.type() ==
typeid(boost::shared_ptr<DataDistributor<T> >));
}
};
template<typename T>
static DataDistributor<T>* GetDataDistributor()
{
std::list<boost::any>::iterator iter =
std::find_if(m_distrubutors.begin(), m_distrubutors.end(),
IsDataType<T>());
//error C2248: 'type_info::type_info' : cannot access private member
//declared in class 'type_info' boost\tuple\detail\tuple_basic.hpp 477
// std::find_if(m_distrubutors.begin(), m_distrubutors.end(),
// boost::lambda::bind(&boost::any::type, _1) ==
// typeid(boost::shared_ptr<DataDistributor<T> >));
....
}