While passing '-std=c++11' to the Legacy Code Tool is not currently supported, I have tested the following workaround:
- Construct a header file that declares the simulation function without c++11 syntax
- Compile the C++ project into a shared static library (using '-std=c++11') that contains the definition of the simulation function
- Create a C++ file with a wrapper function that calls the simulation function
- Create a legacy code struct 'def' as in https://www.mathworks.com/help/simulink/examples/c-object-methods-as-legacy-functions.html
- Set def.Options.language = 'C++', def.HeaderFiles = {'simple_header.hpp'}, and def.HostLibFiles = {'shared_static_library.so'}
- Continue to follow the instructions on the above linked page