I am writing class templates and testing them out. Everything seemed to be fine when I tested out my integers but when I got to my double and char classes the compiler gave me this error:

Code:
In function 'int main()':
93:9: error: cannot bind 'std::basic_ostream<char>' lvalue to 'std::basic_ostream<char>&&'
In file included from /usr/include/c++/4.9/iostream:39:0,
                 from 2:
/usr/include/c++/4.9/ostream:602:5: note: initializing argument 1 of 'std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&&, const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = array<double>]'
     operator<<(basic_ostream<_CharT, _Traits>&& __os, const _Tp& __x)
     ^
95:9: error: cannot bind 'std::basic_ostream<char>' lvalue to 'std::basic_ostream<char>&&'
In file included from /usr/include/c++/4.9/iostream:39:0,
                 from 2:
/usr/include/c++/4.9/ostream:602:5: note: initializing argument 1 of 'std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&&, const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = array<double>]'
     operator<<(basic_ostream<_CharT, _Traits>&& __os, const _Tp& __x)
     ^
101:9: error: cannot bind 'std::basic_ostream<char>' lvalue to 'std::basic_ostream<char>&&'
In file included from /usr/include/c++/4.9/iostream:39:0,
                 from 2:
/usr/include/c++/4.9/ostream:602:5: note: initializing argument 1 of 'std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&&, const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = array<char>]'
     operator<<(basic_ostream<_CharT, _Traits>&& __os, const _Tp& __x)
     ^
102:11: error: cannot bind 'std::istream {aka std::basic_istream<char>}' lvalue to 'std::basic_istream<char>&&'
In file included from /usr/include/c++/4.9/iostream:40:0,
                 from 2:
/usr/include/c++/4.9/istream:872:5: note: initializing argument 1 of 'std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&&, _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = array<char>]'
     operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp& __x)
     ^
103:9: error: cannot bind 'std::basic_ostream<char>' lvalue to 'std::basic_ostream<char>&&'
In file included from /usr/include/c++/4.9/iostream:39:0,
                 from 2:
/usr/include/c++/4.9/ostream:602:5: note: initializing argument 1 of 'std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&&, const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = array<char>]'
     operator<<(basic_ostream<_CharT, _Traits>&& __os, const _Tp& __x)
     ^

This is my code

Code:

#include <iostream>
#include <iomanip>
#include <typeinfo>
#include <string>

using namespace std;


template< typename T > class array {
private:
	int size;
	T *myarray;
public:
// constructor 
	array (int s) {
	size = s;
	myarray = new T [size];
	}

void setArray ( int elem, T val) {
	myarray[elem] = val;
	}

// for loop to display all elements of an array
void getArray () {
     for ( int j = 0; j < size; j++ ) {
        cout << setw( 7 ) << "\n Array placement:  "<< j << setw( 13 ) << "\n Array value: " << myarray[ j ] 
<< " type: " << typeid(myarray[ j ]).name() << endl;
	}

}


void inputArray(){
    cout << "Enter size of array." << endl;
    cin >> size;
    cout << "Enter a value." << endl;
        for ( int j = 0; j < size; j++ ) {
    cin >> myarray[ j ];
        }
}
};

int main() 
{
    
// test
array< int > int_array(2);

int_array.setArray(0,3);

int_array.setArray(1,3.4);

int_array.getArray();

array< float > float_array(3);

float_array.setArray(0,3.4);

float_array.setArray(1,2.8);

float_array.getArray();

array< char > char_array(5);


char_array.setArray(0,'H');
char_array.setArray(1,'E');
char_array.setArray(2,'L');
char_array.setArray(3,'L');
char_array.setArray(4,'O');

char_array.getArray(); // test

cout << "TESTING INTEGERS\n";

   array < int > integers(3);
   cout << "After instantiation, array: " << endl;
   integers.getArray();
   integers.setArray(0,8);
   integers.setArray(1,4);
   integers.setArray(2,9);
   cout << "After initialization, array: " << endl;
   integers.getArray();
   integers.inputArray();
   integers.getArray();

   cout << "\nTESTING DOUBLES\n";
   array < double > dbls(2);
   dbls.setArray(0,0);
   dbls.getArray();
   cout << "After instantiation, array:\n" << dbls << endl;
   dbls.inputArray();
   cout << "After initialization, array:\n" << dbls << endl;
   dbls.getArray();

   cout << "\nTESTING CHARS\n";
   array < char > chrs(2); 
   chrs.getArray();
   cout << "After instantiation, array:\n" << chrs << endl;;
   cin >> chrs;
   cout << "After initialization, array:\n" << chrs << endl;;
/*
   cout << "\nTESTING STRINGS\n";
   array < string > strs; 
   cout << "After instantiation, array:\n" << strs << endl;;
   cin >> strs;
   cout << "After initialization, array:\n" << strs << endl;;
 */

return 0;
}
I tried googling it but a lot of the answers said it was the compiler's fault and I needed a work around but I'm not sure how to do that.