Used forward declarations to fix clang and gcc 4.7 stricter template function reference checking