Boost C++ Libraries: Ticket #8312: Test definitions for throw_exception_test.cpp swapped? https://svn.boost.org/trac10/ticket/8312 <p> I was attempting to learn how to extract the file, function, &amp; line number from a caught exception for logging and noticed the following in boost_throw_exception_test found in throw_exception_test.cpp: </p> <pre class="wiki">char const * const * file=boost::get_error_info&lt;boost::throw_function&gt;(x); char const * const * function=boost::get_error_info&lt;boost::throw_file&gt;(x); </pre><p> It appears the file is retrieving the function name and vice versa. I didn't check to see if there were other instances of this occurrance. </p> <p> I'm novice so I may be very wrong. FYI: I was in this area because I couldn't figure out from the documentation how to access the values placed by BOOST_THROW_EXCEPTION. I finally figured out the following based upon what I found in your test file: </p> <pre class="wiki">if( char const * const * file=boost::get_error_info&lt;boost::throw_file&gt;(e) ) cout &lt;&lt; "The File where it happened:" &lt;&lt; *file &lt;&lt; "\n"; if( char const * const * function=boost::get_error_info&lt;boost::throw_function&gt;(e) ) cout &lt;&lt; "The Function where it happened:" &lt;&lt; *function &lt;&lt; "\n"; if( int const * line=boost::get_error_info&lt;boost::throw_line&gt;(e) ) cout &lt;&lt; "The Line where it happened:" &lt;&lt; *line &lt;&lt; "\n"; </pre><p> -g </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8312 Trac 1.4.3 Emil Dotchevski Tue, 26 Mar 2013 17:26:06 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/8312#comment:1 https://svn.boost.org/trac10/ticket/8312#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> Fixed in trunk revision 83588. Thanks! </p> Ticket