Is there a way to have the C preprocessor change which STL implementation I'm using?
<p>I have code in C++ along the lines of</p>

<pre><code>#include&lt;vector&gt;

std::vector&lt;double&gt; foo;
</code></pre>

<p>I need to compile this code for an embedded platform which uses a custom implementation of STL called <a href="http://ustl.sourceforge.net/" rel="nofollow noreferrer">uSTL</a>. Using it requires <code>#include</code>ing a <code>ustl.h</code> header file and <a href="http://www.ecos.sourceware.org/docs-latest/ref/using-ustl-library.html" rel="nofollow noreferrer">all STL classes are defined in another namespace</a>. The above snippet should therefore become</p>

<pre><code>#include&lt;ustlh.&gt;

ustl::vector&lt;double&gt; foo;
</code></pre>

<p>I don't want to modify the source code because it is library code used by other non-embedded applications. I was thinking of using the C preprocessor to transform <code>#include&lt;vector&gt;</code> to <code>#include&lt;ustl.h&gt;</code> but that seems to be impossible (macro names must be valid identifiers).</p>

<p>Is there another way to have the C preprocessor do this? Or is there another way that would not imply modifying the original source code?</p>