我希望能够从传递给函数的迭代器确定std容器类型(至少是关联或线性)。
我已经搜索了相应的迭代器特征和类型特征,但没有找到合适的。
template <typename RangeIter, typename InputIter>
inline bool filter(RangeIter in_data, InputIter result)
{
...
/* determine the container types here - but how?!? */
std::copy_if(in_data.first, in_data.second, result, /* some predicate code here*/);
...
}