Fix multiple definition of template specialization in cached-function

Several `inline` keywords were missing for some template specializations.