【发布时间】:2015-01-16 01:23:45
【问题描述】:
有没有办法从 C 数组和 C++ STL 容器中获取 iterator 和 const_iterator?
我有这个模板:
template <typename T>
class Another_template {
// implementation
};
template <typename Container>
Another_template<typename Container::iterator>
fun(Container&) {
// implementation
}
我希望上述函数也适用于 C 数组。可能吗?还是应该专门针对 C 数组?
我知道C++有std::array,但是我对C数组很好奇。
【问题讨论】: