// $Id: array.cc,v 1.2 1995/12/30 14:52:43 aml Exp $

#include "utils.hh"
#include "array.hh"

/* Hpux C++ compiler does not handle template functions in header files */

#ifdef hpux 

template<class T>
ostream &operator<<(ostream &s, array<T> &arr) {
    int i;
    
    s << arr.cnt << "\n";
    for(i=0; i<arr.cnt; i++) 
        s << arr[i] << " ";
    return(s);
} 


template<class T>
int operator<=(const T &elem, array<T> &arr) {
    int i;
    
    for(i=0; i<arr.cnt; i++) 
        if (arr[i] == elem) return(TRUE);
    
    return(FALSE);
} 


template<class T>
ofstream &operator<<(ofstream &s, array<T> &arr) {
    int i;
    
    s << arr.cnt << "\n";
    for(i=0; i<arr.cnt; i++) 
        s << arr[i] << " ";
    return(s);
} 

template<class T>
istream &operator>>(istream &s, array<T> &arr) {
    int i;
    
    
    s >> arr.cnt;
    for(i=0; i<arr.cnt; i++) 
        s >> arr[i];
    return(s);
} 

template<class T>
ifstream &operator>>(ifstream &s, array<T> &arr) {
    int i;
    
    
    s >> arr.cnt;
    for(i=0; i<arr.cnt; i++) 
        s >> arr[i];
    return(s);
} 


#endif
