Fix bug that jon discovered that affects attempting to return a reference to an object that shares a memory location with a containing object but has a different type.
This commit is contained in:
@@ -22,7 +22,7 @@ namespace dispatchkit
|
||||
template<typename T, typename Class>
|
||||
T &get_member(T Class::* m, Class *obj)
|
||||
{
|
||||
return obj->*m;
|
||||
return (obj->*m);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -33,7 +33,7 @@ namespace dispatchkit
|
||||
template<typename T, typename Class>
|
||||
void register_member(Dispatch_Engine &s, T Class::* m, const std::string &name)
|
||||
{
|
||||
s.register_function(boost::function<T (Class *)>(boost::bind(&get_member<T, Class>, m, _1)), name);
|
||||
s.register_function(boost::function<T& (Class *)>(boost::bind(&get_member<T, Class>, m, _1)), name);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user