I'm watching for an alternative to "std::ifstream" because "#include " can't include as header in a contract.

My code is:

std::istream& operator>>(std::istream& str, Record& data)
    return str >> data.from >> data.to >> data.rate;

1 Answer 1


You should use the basic CPP string concatenation syntax. Smart contracts should not be bloated. istream is a heavyweight which handles locales and other considerations that are irrelevant to this use case.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.