Quantcast
Channel: Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1616

icc on linux errors

$
0
0

Hi,

I have the following header TdMap.h that I use in a number of other classes to create maps.  This works fine on windows using VC, but trying to port it to linux using icc I get some errors that I don't understand.  Hoping it might be something obvious.  Here is the start of the header file:

#pragma once

#include <map>

template <class K, class T, class C>
class TdMap : public std::map< K, T, C >
{
public:

    bool isEmpty() const { return size() == 0 ? true : false; }
    int length() const { return (int) size(); }
    int entries() const { return (int) size(); }
    bool findValue( const K& key, T& r ) const
    {
        const_iterator i=find(key);
        if(i != end()) {
            r = i->second;
            return true;
        }
        return false;
    }
    bool findIter( const K& key, iterator &iter )
    {
        iterator i=find(key);
        if(i != end()) {
            iter = i;
            return true;
        }
        return false;
    }

the types for iterator and const_iterator get errors as being undefined in both the findValue function and findIter function (both argument list and inside).  But it appears to me that std::map does define them.  I find if I use std::iterator<std::bidirectional_iterator_tag, TdMap> for iterator then it does compile.  But I would like to use the typedef's that I do use on Windows so I don't need to modify all my sources. I'm using XE2011

Thanks!

 


Viewing all articles
Browse latest Browse all 1616

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>