Boost C++ Libraries: Ticket #5814: Problem in boost::any documentation https://svn.boost.org/trac10/ticket/5814 <p> At <a href="http://www.boost.org/doc/libs/1_47_0/doc/html/any/s02.html">http://www.boost.org/doc/libs/1_47_0/doc/html/any/s02.html</a> it seems that the examples functions is_char_ptr &amp; is_string are exchanged. </p> <p> any_cast&lt;const char *&gt; shouldn't throw but it's in a try block while any_cast&lt;std::string&gt; result should be a string that's not convertible to bool contrary to what's done. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5814 Trac 1.4.3 Steven Watanabe Sun, 16 Oct 2011 17:34:34 GMT owner, component changed https://svn.boost.org/trac10/ticket/5814#comment:1 https://svn.boost.org/trac10/ticket/5814#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Matias Capeletto</span> to <span class="trac-author">nasonov</span> </li> <li><strong>component</strong> <span class="trac-field-old">Documentation</span> → <span class="trac-field-new">any</span> </li> </ul> Ticket Steven Watanabe Thu, 14 Feb 2013 18:22:31 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/5814#comment:2 https://svn.boost.org/trac10/ticket/5814#comment:2 <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">invalid</span> </li> </ul> <p> The documentation is correct. </p> <p> a) any_cast&lt;const char*&gt;(operand) can throw because operand is passed by reference b) any_cast&lt;std::string&gt;(&amp;operand) returns std::string* because the operand is a pointer. </p> Ticket