[luabind] dependency question
Brought to you by:
arvidn,
daniel_wallin
From: Enno R. <en...@fu...> - 2003-04-17 22:06:02
|
I've written a simple class that has a string member which I want to be accessible as a readonly property. Do I have to specify a dependency policy, or is it enough to write .property("name", &Region::getName) ? Because in the example below, when I add dependency(result, self), I get the following message from VC7: c:\libraries\luabind\luabind\detail\property.hpp(83) : error C2784: 'int luabind::detail::set(void (__cdecl *)(T &,A1),T *,lua_State *,Policies *)' : could not deduce template argument for 'void (__cdecl *)( &,<template parameter>)' from 'luabind::detail::policy_cons<H,T>' Enno. Sample code: class Region { public: Region(const std::string& name) : m_name(name) {} const std::string& getName(void) const { return m_name; } private: std::string m_name; }; class_<Region>(L, "region") .def(constructor<const std::string&>()) .property("name", &Region::getName, dependency(result, self)) ; |