简体   繁体   中英

#include<utility> in dev c++ header file

i am trying to create a header file in c++ with the following code

#ifndef dictionary_h
#define dictionary_h
#include<utility>
using namespace std;
template <class K,class E>
class dictionary
{
    virtual bool empty() const=0;
    virtual int size() const=0;
    virtual pair<const K,E>* find(const K&) const=0;
    virtual void insert(const pair<const K,E> &)=0;
    virtual void erase(const K&)=0;
};

#endif

but when i hit F9 to compile it says,

[Error] utility: No such file or directory

what is the correct procedure for creating a header file for dev c++ ?

Dev C++ associates .h files with C headers. Renaming it to .hpp should solve the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM