aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-06-02 17:17:45 +0000
committerlloyd <[email protected]>2010-06-02 17:17:45 +0000
commit2429ac85c1d955e637ad014a1de5fd8e396f7ae5 (patch)
tree960e50f1eb110da7b9378956e5a1290dc2e0db83
parent4e96dac64fd310901ba3379e13d78e2b631cadec (diff)
Small cleanups
-rw-r--r--doc/examples/factor.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/doc/examples/factor.cpp b/doc/examples/factor.cpp
index c4d37c92b..58b12d9a5 100644
--- a/doc/examples/factor.cpp
+++ b/doc/examples/factor.cpp
@@ -1,13 +1,12 @@
/*
-* (C) 2009 Jack Lloyd
+* (C) 2009-2010 Jack Lloyd
*
* Distributed under the terms of the Botan license
+*
+* Factor integers using a combination of trial division by small
+* primes, and Pollard's Rho algorithm
*/
-/*
- Factor integers using a combination of trial division by small primes,
- and Pollard's Rho algorithm
-*/
#include <botan/botan.h>
#include <botan/reducer.h>
#include <botan/numthry.h>
@@ -15,8 +14,7 @@ using namespace Botan;
#include <algorithm>
#include <iostream>
-#include <memory>
-
+#include <iterator>
namespace {
@@ -142,8 +140,9 @@ int main(int argc, char* argv[])
std::sort(factors.begin(), factors.end());
std::cout << n << ": ";
- for(u32bit j = 0; j != factors.size(); j++)
- std::cout << factors[j] << " ";
+ std::copy(factors.begin(),
+ factors.end(),
+ std::ostream_iterator<BigInt>(std::cout, " "));
std::cout << "\n";
}
catch(std::exception& e)