Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65504 - in sandbox/chrono/libs/ratio: example test
From: vicente.botet_at_[hidden]
Date: 2010-09-21 03:45:00


Author: viboes
Date: 2010-09-21 03:44:59 EDT (Tue, 21 Sep 2010)
New Revision: 65504
URL: http://svn.boost.org/trac/boost/changeset/65504

Log:
Added ratio_io example
Added:
   sandbox/chrono/libs/ratio/example/display_ex.cpp (contents, props changed)
Text files modified:
   sandbox/chrono/libs/ratio/test/Jamfile.v2 | 1 +
   1 files changed, 1 insertions(+), 0 deletions(-)

Added: sandbox/chrono/libs/ratio/example/display_ex.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/ratio/example/display_ex.cpp 2010-09-21 03:44:59 EDT (Tue, 21 Sep 2010)
@@ -0,0 +1,39 @@
+// io_ex2.cpp ----------------------------------------------------------//
+
+// Copyright 2010 Howard Hinnant
+// Copyright 2010 Vicente J. Botet Escriba
+
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+/*
+This code was adapted by Vicente J. Botet Escriba from Hinnant's html documentation.
+Many thanks to Howard for making his code available under the Boost license.
+*/
+
+#include <boost/ratio/ratio_io.hpp>
+#include <iostream>
+
+int main()
+{
+ using namespace std;
+ using namespace boost;
+
+ cout << "ratio_string<deca, char>::long_name() = "
+ << ratio_string<deca, char>::long_name() << '\n';
+ cout << "ratio_string<deca, char>::short_name() = "
+ << ratio_string<deca, char>::short_name() << '\n';
+
+ cout << "ratio_string<giga, char>::long_name() = "
+ << ratio_string<giga, char>::long_name() << '\n';
+ cout << "ratio_string<giga, char>::short_name() = "
+ << ratio_string<giga, char>::short_name() << '\n';
+
+ cout << "ratio_string<ratio<4, 6>, char>::long_name() = "
+ << ratio_string<ratio<4, 6>, char>::long_name() << '\n';
+ cout << "ratio_string<ratio<4, 6>, char>::short_name() = "
+ << ratio_string<ratio<4, 6>, char>::short_name() << '\n';
+
+ return 0;
+}
+

Modified: sandbox/chrono/libs/ratio/test/Jamfile.v2
==============================================================================
--- sandbox/chrono/libs/ratio/test/Jamfile.v2 (original)
+++ sandbox/chrono/libs/ratio/test/Jamfile.v2 2010-09-21 03:44:59 EDT (Tue, 21 Sep 2010)
@@ -70,5 +70,6 @@
     test-suite "examples"
         :
         [ run ../example/si_physics.cpp ]
+ [ run ../example/display_ex.cpp ]
         ;
 


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