Correct registration of array[]. (Rollback to previous version) to fix broken unit tests.
This commit is contained in:
@@ -114,13 +114,15 @@ namespace dispatchkit
|
|||||||
void bootstrap_random_access_container(Dispatch_Engine &system, const std::string &type)
|
void bootstrap_random_access_container(Dispatch_Engine &system, const std::string &type)
|
||||||
{
|
{
|
||||||
bootstrap_reversible_container<ContainerType>(system, type);
|
bootstrap_reversible_container<ContainerType>(system, type);
|
||||||
|
|
||||||
typedef typename ContainerType::reference(ContainerType::*indexoper)(size_t);
|
typedef typename ContainerType::reference(ContainerType::*indexoper)(size_t);
|
||||||
|
|
||||||
//In the interest of runtime safety for the system, we prefer the at() method for [] access,
|
//In the interest of runtime safety for the system, we prefer the at() method for [] access,
|
||||||
//to throw an exception in an out of bounds condition.
|
//to throw an exception in an out of bounds condition.
|
||||||
register_function(system, indexoper(&ContainerType::at), "[]");
|
system.register_function(
|
||||||
register_function(system, indexoper(&ContainerType::operator[]), "at");
|
boost::function<typename ContainerType::reference (ContainerType *, int)>(indexoper(&ContainerType::at)), "[]");
|
||||||
|
system.register_function(
|
||||||
|
boost::function<typename ContainerType::reference (ContainerType *, int)>(indexoper(&ContainerType::operator[])), "at");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user