in reply to Syntax for passing objects to subroutine

In calcFoo you re-bless the object into the current package which is probably not Boost::Graph.