fixed compilation issue with idle friend function not being declared before usage by template function