Introduction
GCC and other modern C++ compilers often provide support for the Standard Template Library (STL). This provides containers like list and vector, and convenient functionality like strings.Unfortunately, when using some of these in combination, some implementations emit errors such as the following:
/opt/local/gnu/lib/g++-include/std/sinst.h:64: ambiguous template instantiation for `operator >=(const basic_stringThese errors come from just #including the required header files!> &, const char *)' requested
The Workaround
The workaround seems to be to #include <string> before container classes, e.g. #include <list>. In a utility class, which may well be used by other files, id you need to use say <list >, but not <string>, then it would be wise to include string anyway, just before list. For example:- // For list
