Endf in C++

from #454