9

Which version of C++ can I use to implement smart contracts?

For example: C++11, C++14 or C++17? Do we have any constant or doc where it is defined?

Also, in my understanding the code is sandboxed, where can I find the restrictions?

Is the version defined in https://github.com/EOSIO/eos/blob/4f293115f34112e843885befc4a69fce1e137aa2/CMakeLists.txt#L17 ?

11

eosiocpp currently compiles contracts using c++14. cib compiles contracts using the c++17 language, but c++14 library.

sandboxing: contracts are compiled to WASM. Normal OS functions (filesystem, threading, etc.) are not available.

Note: cib requires an up-to-date Firefox (fastest) or Chrome (slow loading).

| improve this answer | |
2

Updated answer: Currently EOS smart contracts are written in C++17. For more details see the official SDK, CDT (Contract Development Toolkit) which is based on clang 7.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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