aboutsummaryrefslogtreecommitdiffstats
path: root/doc/examples
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-06-17 21:48:55 +0000
committerlloyd <[email protected]>2010-06-17 21:48:55 +0000
commitc06b260b3328c5ce4be44c4f1a88feb55ee3dbc4 (patch)
tree41b05df5982b5b2e8a23b55972263d2172d6a9fd /doc/examples
parent0eecae9f21172c0a74ad62acaf77148c94a25be7 (diff)
parent3dde5683f69b9cb9f558bfb18087ce35fbbec78a (diff)
propagate from branch 'net.randombit.botan' (head 294e2082ce9231d6165276e2f2a4153a0116aca3)
to branch 'net.randombit.botan.c++0x' (head 0b695fad10f924601e07b009fcd781191fafcb28)
Diffstat (limited to 'doc/examples')
-rw-r--r--doc/examples/bench.cpp1
-rw-r--r--doc/examples/factor.cpp17
2 files changed, 8 insertions, 10 deletions
diff --git a/doc/examples/bench.cpp b/doc/examples/bench.cpp
index 7054d8563..fe6bdc839 100644
--- a/doc/examples/bench.cpp
+++ b/doc/examples/bench.cpp
@@ -47,7 +47,6 @@ const std::string algos[] = {
"XTEA",
"Adler32",
"CRC32",
- "FORK-256",
"GOST-34.11",
"HAS-160",
"MD2",
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)