Fixed build issue by implicitly capture by reference (of Scene)
authorPhilippe Coval <philippe.coval@osg.samsung.com>
Mon, 7 Mar 2016 10:58:19 +0000 (11:58 +0100)
committerHabib Virji <habib.virji@samsung.com>
Fri, 11 Mar 2016 09:14:07 +0000 (09:14 +0000)
commit802821e8d3061d826ad56fa37a33e86d181bb647
tree6046ad1fa28987e6bb88fc9176610e81637aec63
parente789c31e2b860017f5c358a1ba0cc35e4b5f122a
Fixed build issue by implicitly capture by reference (of Scene)

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/5573
Reviewed-by: Robert Spielmann <spielmann@kellendonk.de>
Reviewed-by: Mats Wichmann <mats@osg.samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Habib Virji <habib.virji@samsung.com>
service/scene-manager/src/Scene.cpp