template <class T> struct greater : binary_function <T,T,bool> {
bool operator() (const T& x, const T& y) const
{return x>y;}
};
template <class T> struct logical_and : binary_function <T,T,bool> {
bool operator() (const T& x, const T& y) const
{return x&&y;}
};
// (i > 5 && i <=10)
countBoost = std::count_if(vecInts.begin(), vecInts.end(),
boost::bind(std::logical_and<bool>(),
^^^^ // ???? Why ????
boost::bind(std::greater<int>(), _1, 5),
boost::bind(std::less_equal<int>(), _1, 10))
);
私の理解に基づいて、パスイン型T
forstd::logical_and<T>
は function のパスイン パラメータの型operator()
です。上記のコードを考えると、 の型はstd::greater
のbool
戻り値によって決定されるようです operator()
。
あれは正しいですか?
ありがとうございました