1// io_ex2.cpp ----------------------------------------------------------//
2
3// Copyright 2010 Howard Hinnant
4// Copyright 2010 Vicente J. Botet Escriba
5
6// Distributed under the Boost Software License, Version 1.0.
7// See http://www.boost.org/LICENSE_1_0.txt
8
9/*
10This code was adapted by Vicente J. Botet Escriba from Hinnant's html documentation.
11Many thanks to Howard for making his code available under the Boost license.
12*/
13
14#include <iostream>
15#include <boost/ratio/ratio_io.hpp>
16
17int main()
18{
19 using namespace std;
20 using namespace boost;
21
22 cout << "ratio_string<deca, char>::prefix() = "
23 << ratio_string<boost::deca, char>::prefix() << '\n';
24 cout << "ratio_string<deca, char>::symbol() = "
25 << ratio_string<boost::deca, char>::symbol() << '\n';
26
27 cout << "ratio_string<giga, char>::prefix() = "
28 << ratio_string<boost::giga, char>::prefix() << '\n';
29 cout << "ratio_string<giga, char>::symbol() = "
30 << ratio_string<boost::giga, char>::symbol() << '\n';
31
32 cout << "ratio_string<ratio<4, 6>, char>::prefix() = "
33 << ratio_string<boost::ratio<4, 6>, char>::prefix() << '\n';
34 cout << "ratio_string<ratio<4, 6>, char>::symbol() = "
35 << ratio_string<boost::ratio<4, 6>, char>::symbol() << '\n';
36
37 return 0;
38}
39
40

source code of boost/libs/ratio/example/display_ex.cpp