A
algatt
template<class K, class T, class W>
class AMI_cache_manager_static: public AMI_cache_manager_base {
private:
map<K,T> data_;
size_t current_size;
W writeout_;
public:
AMI_cache_manager_static(size_t capacity) :
AMI_cache_manager_base(capacity, 0), writeout_() {
current_size = 0;
}
~AMI_cache_manager_static(){
map<K,T>::iterator it;
it = data_.begin();
while (it != data_.end()) {
writeout_(it->second);
it++;
}
}
I have the above code, but where there is the map<K,T>::iterator it;
it gives me an error message that a ; must be placed before it.
If I change map<K,T>::iterator it; to map<string,string>::iterator it;
it works, but I need them as a template since they are not string.
Thanks for any help.
class AMI_cache_manager_static: public AMI_cache_manager_base {
private:
map<K,T> data_;
size_t current_size;
W writeout_;
public:
AMI_cache_manager_static(size_t capacity) :
AMI_cache_manager_base(capacity, 0), writeout_() {
current_size = 0;
}
~AMI_cache_manager_static(){
map<K,T>::iterator it;
it = data_.begin();
while (it != data_.end()) {
writeout_(it->second);
it++;
}
}
I have the above code, but where there is the map<K,T>::iterator it;
it gives me an error message that a ; must be placed before it.
If I change map<K,T>::iterator it; to map<string,string>::iterator it;
it works, but I need them as a template since they are not string.
Thanks for any help.