monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] Re: [PATCH] monotone ls authors


From: Steven E. Harris
Subject: [Monotone-devel] Re: [PATCH] monotone ls authors
Date: Wed, 14 Dec 2005 10:16:35 -0800
User-agent: Gnus/5.110004 (No Gnus v0.4) XEmacs/21.4.13 (cygwin32)

Bruce Stephens <address@hidden> writes:

> +  for (vector< revision<cert> >::const_iterator i = certs.begin();
> +       i != certs.end(); ++i)

Why keep checking against an end that doesn't change?

  for (vector< revision<cert> >::const_iterator i = certs.begin(),
                                                end = certs.end();
       i != end; ++i)


> +  for (std::set< cert_value >::const_iterator i = authors.begin();
> +       i != authors.end(); ++i)
+    {
+      cout << *i << endl;
+    }

How about std::copy to std::ostream_iterator?

  #include <algorithm>
  #include <iterator>

  std::copy( authors.begin(), authors.end(),
             std::ostream_iterator<cret_value>( std::cout, "\n" ) );

-- 
Steven E. Harris





reply via email to

[Prev in Thread] Current Thread [Next in Thread]