The multiplatform engine we're developing for our game uses the EASTL to replace the STL, because of memory, performance and portability reasons. The EASTL can be found here:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2271.html
Because Visual Studio is really good for debugging the STL we're not using the EASTL on Windows while the engine is in development. Also some STL containers as std::queue, std::deque, ... aren't available in the EASTL. Because it doesn't matter we're using the eastl::string on Windows as well, because it's fine for debugging.
What we're doing until now is
#if (GIN_USE_EASTL)
#define ginstl eastl
#else
#define ginstl std
#endif
and GIN_USE_EASTL is defined as 0 on windows. The engine is called Ginkgo, thats where the GIN comes from.
We're using lists, vectors, ... like this
ginstl::list myList;
ginstl::vector myVector;
which works quite fine. But when we use a string or a queue, because of reasons I explained above, we have to write
eastl::string myString;
std::queue myQueue;
which is the reason why i'm posting here, because this is not optimal! What I want to do is use the ginstl:: macro for everything in the engine, without thinking about what implementation to use. So my approach on the problem was this:
#if (GIN_USE_EASTL)
#define ginstl::list eastl::list
#define ginstl::vector eastl::vector
#define ginstl::string eastl::string
#define ginstl::queue std::queue
#else
#define ginstl::list std::list
#define ginstl::vector std::vector
#define ginstl::string eastl::string
#define ginstl::queue std::queue
#endif
But unfortunalty that's not working, because the :: is not allowed in the #define macro. Is there any way to achieve the same thing (be able to specify which implementation I want to use for a specific datastructure) somehow different? I could go for
#define ginstl_list eastl::list
but I would prefer the structure from above! Is there a way (except writing a custom pre-processor) around the problem?