Example #1
0
    friend MyList<T> operator + (const MyList<T> &l1, const T &item){
		MyList<T> tmp;
		tmp.n = l1.n + 1;
		int t = tmp.get_SIZE();
		while( t < tmp.n)	
			tmp.double_space();
		tmp[l1.n] = item;
		return tmp;
	} 
Example #2
0
	friend MyList operator + (const MyList &l1, const MyList &l2){
		MyList<T> tmp; int i;
		tmp.n = l1.n + l2.n;
		int t = tmp.get_SIZE();
		while(t < tmp.n)	
			tmp.double_space();
		for (i = 0; i < l1.n; ++i)
			tmp[i] = l1[i];
		for (i = 0; i < l2.n; ++i)
			tmp[i+l1.n] = l2[i];
		return tmp;	
	}