In the following toy experiment (simplified from a real-world example), why are the template arguments deduced differently depending on whether the template is instantiated