byte.hpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Boost.Units - A C++ library for zero-overhead dimensional analysis and
  2. // unit/quantity manipulation and conversion
  3. //
  4. // Copyright (C) 2014 Erik Erlandson
  5. //
  6. // Distributed under the Boost Software License, Version 1.0. (See
  7. // accompanying file LICENSE_1_0.txt or copy at
  8. // http://www.boost.org/LICENSE_1_0.txt)
  9. #ifndef BOOST_UNITS_SYSTEMS_INFORMATION_BYTE_HPP_INCLUDED
  10. #define BOOST_UNITS_SYSTEMS_INFORMATION_BYTE_HPP_INCLUDED
  11. #include <boost/units/make_system.hpp>
  12. #include <boost/units/unit.hpp>
  13. #include <boost/units/static_constant.hpp>
  14. #include <boost/units/base_units/information/byte.hpp>
  15. namespace boost {
  16. namespace units {
  17. namespace information {
  18. typedef make_system<byte_base_unit>::type system;
  19. typedef unit<dimensionless_type, system> dimensionless;
  20. namespace hu {
  21. namespace byte {
  22. typedef unit<information_dimension, system> info;
  23. } // namespace bit
  24. } // namespace hu
  25. BOOST_UNITS_STATIC_CONSTANT(byte, hu::byte::info);
  26. BOOST_UNITS_STATIC_CONSTANT(bytes, hu::byte::info);
  27. // I'm going to define boost::units::information::info (the "default")
  28. // to be hu::byte::info -- other variants such as hu::bit::info, hu::nat::info, etc
  29. // must be explicitly referred to
  30. typedef hu::byte::info info;
  31. } // namespace information
  32. } // namespace units
  33. } // namespace boost
  34. #endif // BOOST_UNITS_SYSTEMS_INFORMATION_BYTE_HPP_INCLUDED