From 06fb6550801539442c49ea99dc507b092ea8c310 Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 15 Jul 2020 22:14:02 +0200 Subject: [PATCH] Change the declaration of the getter std:function passed to registerLegacySkyFn to return a T rather than a T const &. For the lambdas they return a temporary 'T' rather than a 'T const&'. Binding any reference to this is illegal. --- indra/newview/rlvenvironment.cpp | 2 +- indra/newview/rlvenvironment.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/rlvenvironment.cpp b/indra/newview/rlvenvironment.cpp index d723630fdb..315b855a1f 100644 --- a/indra/newview/rlvenvironment.cpp +++ b/indra/newview/rlvenvironment.cpp @@ -672,7 +672,7 @@ void RlvEnvironment::registerSetEnvFn(const std::string& strFnName, const std::f } template -void RlvEnvironment::registerLegacySkyFn(const std::string& strFnName, const std::function& getFn, const std::function& setFn) +void RlvEnvironment::registerLegacySkyFn(const std::string& strFnName, const std::function< T (LLSettingsSkyPtr_t)>& getFn, const std::function& setFn) { RLV_ASSERT(m_LegacyGetFnLookup.end() == m_LegacyGetFnLookup.find(strFnName)); m_LegacyGetFnLookup.insert(std::make_pair(strFnName, [this, getFn](const std::string& strRlvParam, U32 idxComponent) diff --git a/indra/newview/rlvenvironment.h b/indra/newview/rlvenvironment.h index 0f70e24cae..846b6e2899 100644 --- a/indra/newview/rlvenvironment.h +++ b/indra/newview/rlvenvironment.h @@ -45,7 +45,7 @@ protected: void registerGetEnvFn(const std::string& strFnName, const std::function& getFn); template void registerSetEnvFn(const std::string& strFnName, const std::function& setFn); template void registerSkyFn(const std::string& strFnName, const std::function& getFn, const std::function& setFn); - template void registerLegacySkyFn(const std::string& strFnName, const std::function& getFn, const std::function& setFn); + template void registerLegacySkyFn(const std::string& strFnName, const std::function< T (LLSettingsSky::ptr_t)>& getFn, const std::function& setFn); // Command handling helpers template std::string handleGetFn(const std::function& fn);