Igniters,

There is widespread opinion that STL types should not be used in public
(exported) APIs to maximize portability. It means that even such simple
types like std::string or std:vector shouldn't appear in any public
definitions.

Pros:
Better portability => less problems when Ignite library will be linked to
user applications possibly created with other compilers.

Cons:
Uglier and heavier interfaces. E.g., instead of
std::string ReadString(const char* fieldName)|

it will be something like
char* ReadString(const char* fieldName, const CharAllocator& alloc);
class CharAllocator {
public:
    virtual char* Allocate(int32_t len) = 0;
}

So should we stick to this practice and avoid STL classes in public API?

Vladimir.

Reply via email to