gcc 4.7 template errors: a detailed explanation