display_ex.cpp 1.3 KB

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