bit.hpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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_BASE_UNITS_INFORMATION_BIT_HPP_INCLUDED
  10. #define BOOST_UNITS_BASE_UNITS_INFORMATION_BIT_HPP_INCLUDED
  11. #include <string>
  12. #include <boost/units/config.hpp>
  13. #include <boost/units/base_unit.hpp>
  14. #include <boost/units/physical_dimensions/information.hpp>
  15. namespace boost {
  16. namespace units {
  17. namespace information {
  18. struct bit_base_unit : public base_unit<bit_base_unit, information_dimension, -700>
  19. {
  20. static std::string name() { return("bit"); }
  21. static std::string symbol() { return("b"); }
  22. };
  23. } // namespace information
  24. } // namespace units
  25. } // namespace boost
  26. #if BOOST_UNITS_HAS_BOOST_TYPEOF
  27. #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
  28. BOOST_TYPEOF_REGISTER_TYPE(boost::units::information::bit_base_unit)
  29. #endif
  30. #endif // BOOST_UNITS_BASE_UNITS_INFORMATION_BIT_HPP_INCLUDED