Problem was observed while building on Tizen:2.4:Mobile (g++ 4.9.2):
error: capture of non-variable 'OIC::Service::Scene::m_name'
[&actions, &m_name](const SceneMemberResource::Ptr& member)
Futher explanation from Thiago Macieira <thiago.macieira@intel.com> :
Looking up the C++ standard, it says that :
"An entity that is designated by a simple-capture [...]
shall be this or a variable with automatic storage duration".
That means you cannot capture non-static members by name and you
have to capture the whole object.
Using [&] accomplishes capturing of "this".
Change-Id: Id9db9ca55b858b5c39cee48a5eb9b25ad9e59b41
Origin: https://github.com/TizenTeam/iotivity/tree/sandbox/pcoval/for-upstream
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/5497
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Habib Virji <habib.virji@samsung.com>
auto sceneMemberRes = m_sceneCollectionResource->findSceneMembers(m_name);
std::for_each(sceneMemberRes.begin(), sceneMemberRes.end(),
- [&actions, &m_name](const SceneMemberResource::Ptr& member)
+ [&](const SceneMemberResource::Ptr& member)
{
RCSResourceAttributes actionParam;