mathworks / libmexclass

libmexclass is a MATLAB framework which enables users to implement the functionality of MATLAB classes in terms of equivalent C++ classes using MEX.
BSD 3-Clause "New" or "Revised" License
5 stars 1 forks source link

Closes #62: `ProxyManager::getProxy` adds elements to the map if the input `ID` doesn't already exist. #63

Closed sgilmore10 closed 1 year ago

sgilmore10 commented 1 year ago
  1. This PR fixes a bug in the ProxyManager::getProxy method. Because ProxyManager::getProxy uses operator[] to lookup IDs in the map, if the ID is not a key already, it will be added to the map. To fix this bug, we should find instead of operator[].

  2. I also changed ProxyManager::getProxy to return a libmexclass::proxy::ProxyResult, which is a typedef to std::variant<std::shared_ptr<Proxy>, libmexclass::error::Error>.