|
Evo C++ Library v0.5.1
|
Evo STL compatibility info.
std::vector (dynamic contiguous array)std::string (dynamic string)std::string_view (substring reference)std::unordered_set (hash table as set)std::unordered_map (hash table as map)std::optional (but is only for primitive types)begin(), end(), cbegin(), cend()Evo containers support C++11 initializer lists.
Example:
Evo containers support C++11 range-based for loops.
const containers if possible – Evo containers have an asconst() method to make this easyExample:
Evo supports implicitly converting STL strings (const std::string& and const std::string*) to StringBase so STL strings can be passed to functions that accept Evo string types. Simply include STL string header first and Evo will try to auto-detect and enable std::string support. C++17 std::string_view is also supported as well, when supported by the compiler.
If you want to be explicit about passing an STL string to a function using Evo strings, wrap it like this: evo::StringBase(stdstring) – see example below. Note that StringBase is a common base class for all Evo strings and works as a primitive form of SubString
See String Passing
Note that in some cases you may run into problems with "too many implicit conversions." Here's an example:
You may also enable STL string compatibility directly with a preprocessor define, before including any Evo headers:
For more info on enabling STL string compatibility see: EVO_STD_STRING and EVO_STD_STRING_VIEW
Evo provides some helpers for std::map container lookups.
1.8.13