= Reporting Bugs in Boost Components = The information on this page complements [http://www.boost.org/more/bugs.htm the bug reporting guidelines on the main site]. == Reporting a Bug == Please [http://svn.boost.org/trac/boost/newticket enter a new Trac ticket] for the bug. Be sure to set the Component field properly. You can also report the bug on one of the mailing lists, referencing the ticket number. The maintainers of the Boost component affected by the bug will appreciate it if you already have an idea how to fix it. It's best if you submit a patch, as explained [http://www.boost.org/more/bugs.htm here]. It's even more helpful if you submit a new test. This guarantees that the bug stays fixed. == Submitting a Test == Creating a test is easy. We'll illustrate this with an [http://lists.boost.org/boost-users/2007/07/29648.php example] taken from the [http://lists.boost.org/boost-users/ boost-users] mailing list: The following code using Lambda with vector iterators compiles without complaint: {{{ vector v; find_if(v.begin(), v.end(), _1 == 'x'); }}} Ditto for this code, which uses istream_iterators: {{{ istream_iterator b1(cin); istream_iterator e1; find_if(b1, e1, _1 == 'x'); }}} But the same code with istreambuf_iterators gets rejected: {{{ istreambuf_iterator b2(cin); istreambuf_iterator e2; find_if(b2, e2, _1 == 'x'); }}} Error messages from VC8 and gcc 4.1.1 are below. Am I doing something wrong, is there a bug in Lambda regarding istreambuf_iterators, or is this a restriction that I didn't see documented somewhere? Here's the test that you, as the hypothetical reporter of the above bug, can submit as an attachment to the new ticket: {{{ #include #include #include #include #include int main() { using namespace boost::lambda; std::stringstream is( "ax2" ); std::istreambuf_iterator b2( is ); std::istreambuf_iterator e2; std::istreambuf_iterator i = std::find_if( b2, e2, _1 == 'x' ); BOOST_TEST( *i == 'x' ); BOOST_TEST( std::distance( i, e2 ) == 2 ); return boost::report_errors(); } }}} Note that even though the bug report only states that the code doesn't compile, the test checks whether the code, when compiled, actually does what it's expected to do. This may seem trivial, but it does help. Be sure to not forget the `return boost::report_errors()` statement at the end of `main`. Thank you in advance for your bug reports and tests!