This will work if you change it to the correct type returned by CELL::neighbor. Note that this is not necessarily the same type as CELL. I suggest you use auto neighborCell = cell.neighbor(c_i);
.
You may also be interested in the core and FAQ sections of the user guide (“how to write your own post processor”)