Collapse with C++