Simple implementation of a generic stack
Ownership 

Yes raw pointers are fine if you are not transferring ownership (Is the class responsibility to delete them).

Pop function 

Also I am not sure if this will compile for any data other than pointers and types convertible to 0 since you return NULL. (Also is better to use nullptr consistently).

 T pop() {
    if (head == nullptr) {
        std::cout&lt;&lt;"Error stack is empty"&lt;&lt;std::endl;
        return NULL;
    } else {
        Node *temp = head;
        T result = temp-&gt;data;
        head = head-&gt;next;
        delete temp;
        return result;
    }
}


IMO it will be better to throw a underflow exception since is the client responsibility to check that is not empty before. Also avoid returning the data since we will be throwing an exception (For more info on this check out this article http://ptgmedia.pearsoncmg.com/images/020163371x/supplements/Exception_Handling_Article.html)

 void pop() {
    if (head == nullptr) 
        throw std::underflow_error("underflow");

    Node *temp = head;
    head = head-&gt;next;
    delete temp;   
 }


So the client will have to call peek before pop to get the same effect.

Parameters: 

In most parameter like this (T type) you should change it to (const T&amp; type)
to avoid copying. Even better would be to provide an overload for rvalue references like this (T&amp;&amp;)

peekAll function 

This function seams kind of weird. Why are you deleting temp? . It seams that after the while loop temp should always be nullptr.  And aren't you just writing the stack on the stream.  I would just omit this function and move it to the &lt;&lt; operator overload.

Also you should implement an empty function.