promises: convert to c++