Evo C++ Library v0.5.1
String Passing

Evo strings and containers use Sharing so copying is generally efficient (though see warning about thread safety).

This shows the preferred ways of passing a string with Evo.

These suggestions also apply in general to Evo containers like List, and other complex objects.

For passing read-only strings it's often useful to use SubString to show how the string is used. A function taking a SubString argument explicitly shows the string is read-only and prevents further Sharing when copied to another String (i.e. sharing stops here), and is often useful in multithreaded situations (with sychronization as needed).

Alternatively, for passing read-only strings with STL Compatibility use StringBase. This works the same way as SubString.

See also: Unsafe Pointer Referencing