I\'m trying to implement my own qDebug() style debug-output stream, this is basically what I have so far:
struct debug
{
#if defined(DEBUG)
             
        
The stream insertion (<<) and extraction (>>) are supposed to be non-members.
My question is basically, how can I tell when the return type of operator<< isn't going to be used by another operator<< (and so append endl)?
You cannot. Create a member function to specially append this or append an endl once those chained calls are done with. Document your class well so that the clients know how to use it. That's your best bet.