C++: fix refactoring breakage in filter_optional.