S
Shawn McGrath
Can you use the standard binders (std::bind2nd) on a functor taking two
different parameter types?
Here's my code now:
template <typename T>
struct compareValString : public std::binary_function
<resources::ScopedType<T>, std::string, bool >
{
typedef typename resources::ScopedType<T> ST;
inline bool operator()(const ST &v, const std::string &n)
{
return false;
}
};
....
values.erase(std::remove_if(values.begin(), values.end(),
std::bind2nd(compareValString<ResourceType>(), *it)), values.end());
//it is an iterator for a vector of strings.
different parameter types?
Here's my code now:
template <typename T>
struct compareValString : public std::binary_function
<resources::ScopedType<T>, std::string, bool >
{
typedef typename resources::ScopedType<T> ST;
inline bool operator()(const ST &v, const std::string &n)
{
return false;
}
};
....
values.erase(std::remove_if(values.begin(), values.end(),
std::bind2nd(compareValString<ResourceType>(), *it)), values.end());
//it is an iterator for a vector of strings.