store c++ function in value