Category : api-design

I’m trying to provide a C++ Interface from an existing C-API. The C-API is pretty small and the header file includes two opaque structs as well as some simple functions. The header looks similiar to this: typedef struct C_Element C_Element; // multiple getter to retrieve the members data typedef struct C_List C_List; C_List *create(); void ..

Read more

In a c++98 project I have a class Items that wraps a std::map: #include <string> #include <map> class Item { /* … */ }; // Some class holding some data class Items { public: typedef std::map<std::string,Item> container_type; typedef container_type::iterator iterator; Items() {} iterator find(const String& k) { return i_map.find(k); } iterator end() { return i_map.end(); ..

Read more