I am trying to write a header file in C++.It has some classes which make use of C++ STL.Say for example the following code
foo.h
N.B I have included the required header files and namespace.
Am not sure how to write the operator definition for [] in the corresponding C++ file.
foo.h
Code:
template <class key,class val> class d_array {
public :
map <key,val> h;
val &operator[](key k);
val &operator[](map <key,val>::iterator itr);
void clear();
int defined(key k);
void undefine(key k);
};
Am not sure how to write the operator definition for [] in the corresponding C++ file.
Comment