|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r60944 - sandbox/xint/libs/xint/example
From: pbristow_at_[hidden]
Date: 2010-03-30 09:54:40
Author: pbristow
Date: 2010-03-30 09:54:39 EDT (Tue, 30 Mar 2010)
New Revision: 60944
URL: http://svn.boost.org/trac/boost/changeset/60944
Log:
Ultra simple example
Added:
sandbox/xint/libs/xint/example/xint_simple.cpp (contents, props changed)
Added: sandbox/xint/libs/xint/example/xint_simple.cpp
==============================================================================
--- (empty file)
+++ sandbox/xint/libs/xint/example/xint_simple.cpp 2010-03-30 09:54:39 EDT (Tue, 30 Mar 2010)
@@ -0,0 +1,55 @@
+// xint_simple.cpp
+
+// Copyright Paul A. Bristow 2010
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+/**
+\file
+\brief Simple demo of xint including stream output.
+\details
+Tests a few operators for output to a std:: stream.
+**/
+
+#include <boost/xint/xint.hpp>
+
+#include <iostream>
+using std::cout;
+using std::endl;
+#include <iomanip>
+using std::setprecision;
+using std::setw;
+#include <limits>
+
+int main()
+{
+ // TODO I think you should get this into the boost namespace now or there will be zillions of places to change.
+ //using namespace boost::xint
+
+ using namespace xint;
+ using xint::integer;
+
+//[xint_simple_snippet_1
+
+ integer a(2);
+ integer b = 3;
+
+ cout << a << ", b = " << b << ", a + b = " << a + b << endl;
+
+//] [xint_simple_snippet_1]
+
+
+
+ return 0;
+} // int(main)
+
+/*
+
+Output
+
+*/
+
+
+
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk