Boost C++ Libraries: Ticket #2397: for_each: do not expose basic_string (implementation type) https://svn.boost.org/trac10/ticket/2397 <p> <code>symbols&lt;Char,T&gt;::for_each</code>'s argument currently accepts two args: </p> <blockquote> <p> <code>(basic_string&lt;Char&gt;&amp; str, T&amp; val)</code> </p> </blockquote> <p> <br /> </p> <p> I know it's a slight interface change, but I think it should be changed to: </p> <blockquote> <p> <code>(Char const* str, T&amp; val)</code> </p> </blockquote> <p> (i.e. change <code>s</code> into <code>s.c_str()</code> in <code>f</code> calls in <code>tst_map.hpp</code> and <code>detail/tst.hpp</code>), since: </p> <ol><li>if I'm not mistaken the API is <code>Char const*</code> everywhere else anyway (and <code>basic_string</code> is only used internally as a <code>for_each</code> implementation detail, but is not exposed anywhere else), </li></ol><ol start="2"><li>it lets the user do: <pre class="wiki"> sym1.for_each(symX.add); sym2.for_each(symX.add); sym3.for_each(symX.add); ... </pre></li></ol><p> to merge multiple symbol tables together, which is nicer than having to write a one-line functor around <code>symX.add</code> just to do the required <code>c_str</code> call. </p> <p> Thanks, François </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2397 Trac 1.4.3 François Barel <frabar666@…> Thu, 05 Mar 2009 17:48:08 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/2397#comment:1 https://svn.boost.org/trac10/ticket/2397#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Solved in Spirit2X SVN (<a class="changeset" href="https://svn.boost.org/trac10/changeset/1090" title="Cosmetical. ">r1090</a>) </p> Ticket