Same comment as previously. key, group, tip, pose should be const&. There is no need to state to be ptr either (for consistency reasons), although I do like having a ptr so it is apparent to the caller the arg is modified. Result should be returned by value. Please please please make this change :) Pretty please.