Correct registration of array[]. (Rollback to previous version) to fix broken unit tests.

This commit is contained in:
Jason Turner
2009-07-13 03:04:47 +00:00
parent 7f71c77e56
commit 45fbe2028a

View File

@@ -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");
} }
/** /**