Eliminate warning in shape_cast by performing a static_cast
Add grid() free function