summaryrefslogtreecommitdiff
path: root/boost/units
diff options
context:
space:
mode:
authorChanho Park <chanho61.park@samsung.com>2014-12-11 09:55:56 (GMT)
committerChanho Park <chanho61.park@samsung.com>2014-12-11 09:55:56 (GMT)
commit08c1e93fa36a49f49325a07fe91ff92c964c2b6c (patch)
tree7a7053ceb8874b28ec4b868d4c49b500008a102e /boost/units
parentbb4dd8289b351fae6b55e303f189127a394a1edd (diff)
downloadboost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.zip
boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.tar.gz
boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.tar.bz2
Imported Upstream version 1.57.0upstream/1.57.0
Diffstat (limited to 'boost/units')
-rw-r--r--boost/units/base_units/information/bit.hpp42
-rw-r--r--boost/units/base_units/information/byte.hpp36
-rw-r--r--boost/units/base_units/information/hartley.hpp30
-rw-r--r--boost/units/base_units/information/nat.hpp30
-rw-r--r--boost/units/base_units/information/shannon.hpp36
-rw-r--r--boost/units/config.hpp9
-rw-r--r--boost/units/detail/utility.hpp75
-rw-r--r--boost/units/io.hpp4
-rw-r--r--boost/units/limits.hpp7
-rw-r--r--boost/units/physical_dimensions/information.hpp44
-rw-r--r--boost/units/quantity.hpp2
-rw-r--r--boost/units/scale.hpp4
-rw-r--r--boost/units/systems/information.hpp20
-rw-r--r--boost/units/systems/information/bit.hpp30
-rw-r--r--boost/units/systems/information/byte.hpp42
-rw-r--r--boost/units/systems/information/hartley.hpp30
-rw-r--r--boost/units/systems/information/nat.hpp30
-rw-r--r--boost/units/systems/information/prefixes.hpp43
-rw-r--r--boost/units/systems/information/shannon.hpp30
-rw-r--r--boost/units/systems/si/codata/alpha_constants.hpp1
-rw-r--r--boost/units/systems/si/codata/deuteron_constants.hpp1
-rw-r--r--boost/units/systems/si/codata/electromagnetic_constants.hpp1
-rw-r--r--boost/units/systems/si/codata/electron_constants.hpp1
-rw-r--r--boost/units/systems/si/codata/helion_constants.hpp1
-rw-r--r--boost/units/systems/si/codata/muon_constants.hpp1
-rw-r--r--boost/units/systems/si/codata/neutron_constants.hpp1
-rw-r--r--boost/units/systems/si/codata/physico-chemical_constants.hpp1
-rw-r--r--boost/units/systems/si/codata/proton_constants.hpp1
-rw-r--r--boost/units/systems/si/codata/tau_constants.hpp1
-rw-r--r--boost/units/systems/si/codata/triton_constants.hpp1
-rw-r--r--boost/units/systems/si/codata/universal_constants.hpp1
-rw-r--r--boost/units/units_fwd.hpp2
32 files changed, 485 insertions, 73 deletions
diff --git a/boost/units/base_units/information/bit.hpp b/boost/units/base_units/information/bit.hpp
new file mode 100644
index 0000000..d3cd5d7
--- /dev/null
+++ b/boost/units/base_units/information/bit.hpp
@@ -0,0 +1,42 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2014 Erik Erlandson
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_INFORMATION_BIT_BASE_UNIT_HPP
+#define BOOST_UNITS_INFORMATION_BIT_BASE_UNIT_HPP
+
+#include <string>
+
+#include <boost/units/config.hpp>
+#include <boost/units/base_unit.hpp>
+#include <boost/units/physical_dimensions/information.hpp>
+
+namespace boost {
+namespace units {
+namespace information {
+
+struct bit_base_unit : public base_unit<bit_base_unit, information_dimension, -700>
+{
+ static std::string name() { return("bit"); }
+ static std::string symbol() { return("b"); }
+};
+
+} // namespace information
+} // namespace units
+} // namespace boost
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::information::bit_base_unit)
+
+#endif
+
+
+#endif // BOOST_UNITS_INFORMATION_BIT_BASE_UNIT_HPP
diff --git a/boost/units/base_units/information/byte.hpp b/boost/units/base_units/information/byte.hpp
new file mode 100644
index 0000000..61898bf
--- /dev/null
+++ b/boost/units/base_units/information/byte.hpp
@@ -0,0 +1,36 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2014 Erik Erlandson
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_INFORMATION_BYTE_HPP
+#define BOOST_UNIT_SYSTEMS_INFORMATION_BYTE_HPP
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/units_fwd.hpp>
+#include <boost/units/base_units/information/bit.hpp>
+
+namespace boost {
+namespace units {
+namespace information {
+
+typedef scaled_base_unit<boost::units::information::bit_base_unit, scale<2, static_rational<3> > > byte_base_unit;
+
+} // namespace information
+
+template<>
+struct base_unit_info<information::byte_base_unit> {
+ static const char* name() { return("byte"); }
+ static const char* symbol() { return("B"); }
+};
+
+} // namespace units
+} // namespace boost
+
+#endif // BOOST_UNIT_SYSTEMS_INFORMATION_BYTE_HPP
diff --git a/boost/units/base_units/information/hartley.hpp b/boost/units/base_units/information/hartley.hpp
new file mode 100644
index 0000000..8184b24
--- /dev/null
+++ b/boost/units/base_units/information/hartley.hpp
@@ -0,0 +1,30 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2014 Erik Erlandson
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_INFORMATION_HARTLEY_HPP
+#define BOOST_UNIT_SYSTEMS_INFORMATION_HARTLEY_HPP
+
+#include <boost/units/conversion.hpp>
+#include <boost/units/base_units/information/bit.hpp>
+
+BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(information, hartley,
+ "hartley", "Hart",
+ 3.321928094887363,
+ boost::units::information::bit_base_unit,
+ -703);
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::information::hartley_base_unit)
+
+#endif
+
+#endif // BOOST_UNIT_SYSTEMS_INFORMATION_HARTLEY_HPP
diff --git a/boost/units/base_units/information/nat.hpp b/boost/units/base_units/information/nat.hpp
new file mode 100644
index 0000000..24c1d10
--- /dev/null
+++ b/boost/units/base_units/information/nat.hpp
@@ -0,0 +1,30 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2014 Erik Erlandson
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_INFORMATION_NAT_HPP
+#define BOOST_UNIT_SYSTEMS_INFORMATION_NAT_HPP
+
+#include <boost/units/conversion.hpp>
+#include <boost/units/base_units/information/bit.hpp>
+
+BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(information, nat,
+ "nat", "nat",
+ 1.442695040888964,
+ boost::units::information::bit_base_unit,
+ -702);
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::information::nat_base_unit)
+
+#endif
+
+#endif // BOOST_UNIT_SYSTEMS_INFORMATION_NAT_HPP
diff --git a/boost/units/base_units/information/shannon.hpp b/boost/units/base_units/information/shannon.hpp
new file mode 100644
index 0000000..f76efae
--- /dev/null
+++ b/boost/units/base_units/information/shannon.hpp
@@ -0,0 +1,36 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2014 Erik Erlandson
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNIT_SYSTEMS_INFORMATION_SHANNON_HPP
+#define BOOST_UNIT_SYSTEMS_INFORMATION_SHANNON_HPP
+
+#include <boost/units/scaled_base_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+#include <boost/units/units_fwd.hpp>
+#include <boost/units/base_units/information/bit.hpp>
+
+namespace boost {
+namespace units {
+namespace information {
+
+typedef scaled_base_unit<boost::units::information::bit_base_unit, scale<1, static_rational<1> > > shannon_base_unit;
+
+} // namespace information
+
+template<>
+struct base_unit_info<information::shannon_base_unit> {
+ static const char* name() { return("shannon"); }
+ static const char* symbol() { return("Sh"); }
+};
+
+} // namespace units
+} // namespace boost
+
+#endif // BOOST_UNIT_SYSTEMS_INFORMATION_SHANNON_HPP
diff --git a/boost/units/config.hpp b/boost/units/config.hpp
index 9e8a74f..694abd5 100644
--- a/boost/units/config.hpp
+++ b/boost/units/config.hpp
@@ -29,7 +29,7 @@
///INTERNAL ONLY
#define BOOST_UNITS_HAS_TYPEOF 1
#else
- #if (__GNUC__ && __cplusplus && __GNUC__ >= 3)
+ #if (__GNUC__ && __cplusplus)
///INTERNAL ONLY
#define BOOST_UNITS_HAS_TYPEOF 1
///INTERNAL ONLY
@@ -67,13 +67,6 @@
#error Boost.Units requires function template partial ordering
#endif
- #ifdef BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
- #error Boost.Units requires explicit function template arguments
- #endif
-
- #ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
- #error Boost.Units requires partial specialization
- #endif
#endif
diff --git a/boost/units/detail/utility.hpp b/boost/units/detail/utility.hpp
index da46b45..1ffa3dc 100644
--- a/boost/units/detail/utility.hpp
+++ b/boost/units/detail/utility.hpp
@@ -11,18 +11,9 @@
#ifndef BOOST_UNITS_UTILITY_HPP
#define BOOST_UNITS_UTILITY_HPP
-#include <cstdlib>
#include <typeinfo>
#include <string>
-
-#if defined(__GLIBCXX__) || defined(__GLIBCPP__)
-#define BOOST_UNITS_USE_DEMANGLING
-#include <cxxabi.h>
-#endif // __GNUC__
-
-#ifdef BOOST_UNITS_USE_DEMANGLING
-
-#include <boost/algorithm/string/replace.hpp>
+#include <boost/core/demangle.hpp>
namespace boost {
@@ -34,71 +25,33 @@ inline
std::string
demangle(const char* name)
{
- // need to demangle C++ symbols
- char* realname;
- std::size_t len;
- int stat;
-
- realname = abi::__cxa_demangle(name,NULL,&len,&stat);
-
- if (realname != NULL)
- {
- std::string out(realname);
-
- std::free(realname);
-
- boost::replace_all(out,"boost::units::","");
-
- return out;
- }
-
- return std::string("demangle :: error - unable to demangle specified symbol");
-}
+ std::string demangled = core::demangle(name);
-} // namespace detail
+ const std::string::size_type prefix_len = sizeof("boost::units::") - 1;
+ std::string::size_type i = 0;
+ for (;;)
+ {
+ std::string::size_type pos = demangled.find("boost::units::", i, prefix_len);
+ if (pos == std::string::npos)
+ break;
-template<class L>
-std::string simplify_typename(const L& /*source*/)
-{
- const std::string demangled = detail::demangle(typeid(L).name());
+ demangled.erase(pos, prefix_len);
+ i = pos;
+ }
return demangled;
}
-} // namespace units
-
-} // namespace boost
-
-#else // BOOST_UNITS_USE_DEMANGLING
-
-namespace boost {
-
-namespace units {
-
-namespace detail {
-
-inline
-std::string
-demangle(const char* name)
-{
- return name;
-}
-
} // namespace detail
template<class L>
-std::string simplify_typename(const L& /*source*/)
+inline std::string simplify_typename(const L& /*source*/)
{
- return std::string(typeid(L).name());
+ return detail::demangle(typeid(L).name());
}
} // namespace units
} // namespace boost
-// To get system-specific predefined macros:
-// gcc -arch ppc -dM -E - < /dev/null | sort
-
-#endif // BOOST_UNITS_USE_DEMANGLING
-
#endif // BOOST_UNITS_UTILITY_HPP
diff --git a/boost/units/io.hpp b/boost/units/io.hpp
index cd49da7..577635d 100644
--- a/boost/units/io.hpp
+++ b/boost/units/io.hpp
@@ -761,7 +761,9 @@ typedef list<scale<2, static_rational<10> >,
list<scale<2, static_rational<50> >,
list<scale<2, static_rational<60> >,
list<scale<2, static_rational<70> >,
- dimensionless_type> > > > > > > binary_prefixes;
+ list<scale<2, static_rational<80> >,
+ list<scale<2, static_rational<90> >,
+ dimensionless_type> > > > > > > > > binary_prefixes;
template<class Os, class Quantity>
struct print_default_t {
diff --git a/boost/units/limits.hpp b/boost/units/limits.hpp
index 2c8a0bf..a8b6f73 100644
--- a/boost/units/limits.hpp
+++ b/boost/units/limits.hpp
@@ -18,6 +18,7 @@
#include <limits>
+#include <boost/config.hpp>
#include <boost/units/units_fwd.hpp>
namespace std {
@@ -30,8 +31,14 @@ class numeric_limits< ::boost::units::quantity<Unit, T> >
static const bool is_specialized = std::numeric_limits<T>::is_specialized;
static quantity_type (min)() { return(quantity_type::from_value((std::numeric_limits<T>::min)())); }
static quantity_type (max)() { return(quantity_type::from_value((std::numeric_limits<T>::max)())); }
+#ifndef BOOST_NO_CXX11_NUMERIC_LIMITS
+ static quantity_type (lowest)() { return(quantity_type::from_value((std::numeric_limits<T>::lowest)())); }
+#endif
static const int digits = std::numeric_limits<T>::digits;
static const int digits10 = std::numeric_limits<T>::digits10;
+#ifndef BOOST_NO_CXX11_NUMERIC_LIMITS
+ static const int max_digits10 = std::numeric_limits<T>::max_digits10;
+#endif
static const bool is_signed = std::numeric_limits<T>::is_signed;
static const bool is_integer = std::numeric_limits<T>::is_integer;
static const bool is_exact = std::numeric_limits<T>::is_exact;
diff --git a/boost/units/physical_dimensions/information.hpp b/boost/units/physical_dimensions/information.hpp
new file mode 100644
index 0000000..c0c7145
--- /dev/null
+++ b/boost/units/physical_dimensions/information.hpp
@@ -0,0 +1,44 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2014 Erik Erlandson
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_INFORMATION_BASE_DIMENSION_HPP
+#define BOOST_UNITS_INFORMATION_BASE_DIMENSION_HPP
+
+#include <boost/units/config.hpp>
+#include <boost/units/base_dimension.hpp>
+
+namespace boost {
+namespace units {
+
+/// base dimension of information
+struct information_base_dimension :
+ boost::units::base_dimension<information_base_dimension, -700>
+{ };
+
+} // namespace units
+} // namespace boost
+
+#if BOOST_UNITS_HAS_BOOST_TYPEOF
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(boost::units::information_base_dimension)
+
+#endif
+
+namespace boost {
+namespace units {
+
+/// dimension of information
+typedef information_base_dimension::dimension_type information_dimension;
+
+} // namespace units
+} // namespace boost
+
+#endif
diff --git a/boost/units/quantity.hpp b/boost/units/quantity.hpp
index 3cd6682..7bdb78e 100644
--- a/boost/units/quantity.hpp
+++ b/boost/units/quantity.hpp
@@ -85,7 +85,7 @@ struct disable_if_is_same<T, T> {};
}
/// class declaration
-template<class Unit,class Y = double>
+template<class Unit,class Y>
class quantity
{
// base units are not the same as units.
diff --git a/boost/units/scale.hpp b/boost/units/scale.hpp
index 513d3a1..507c7fb 100644
--- a/boost/units/scale.hpp
+++ b/boost/units/scale.hpp
@@ -94,7 +94,7 @@ struct scale<base_, exponent_ > \
#define BOOST_UNITS_SCALE_DEF(exponent_,value_,name_,symbol_) \
BOOST_UNITS_SCALE_SPECIALIZATION(10,static_rational<exponent_>,value_, name_, symbol_)
-BOOST_UNITS_SCALE_DEF(-24, 1e-24 ,yocto, y);
+BOOST_UNITS_SCALE_DEF(-24, 1e-24, yocto, y);
BOOST_UNITS_SCALE_DEF(-21, 1e-21, zepto, z);
BOOST_UNITS_SCALE_DEF(-18, 1e-18, atto, a);
BOOST_UNITS_SCALE_DEF(-15, 1e-15, femto, f);
@@ -122,6 +122,8 @@ BOOST_UNITS_SCALE_SPECIALIZATION(2, static_rational<30>, 1073741824.0, gibi, Gi)
BOOST_UNITS_SCALE_SPECIALIZATION(2, static_rational<40>, 1099511627776.0, tebi, Ti);
BOOST_UNITS_SCALE_SPECIALIZATION(2, static_rational<50>, 1125899906842624.0, pebi, Pi);
BOOST_UNITS_SCALE_SPECIALIZATION(2, static_rational<60>, 1152921504606846976.0, exbi, Ei);
+BOOST_UNITS_SCALE_SPECIALIZATION(2, static_rational<70>, 1180591620717411303424.0, zebi, Zi);
+BOOST_UNITS_SCALE_SPECIALIZATION(2, static_rational<80>, 1208925819614629174706176.0, yobi, Yi);
#undef BOOST_UNITS_SCALE_DEF
#undef BOOST_UNITS_SCALE_SPECIALIZATION
diff --git a/boost/units/systems/information.hpp b/boost/units/systems/information.hpp
new file mode 100644
index 0000000..a3ceb65
--- /dev/null
+++ b/boost/units/systems/information.hpp
@@ -0,0 +1,20 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2014 Erik Erlandson
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_INFORMATION_HPP
+#define BOOST_UNITS_INFORMATION_HPP
+
+#include <boost/units/systems/information/byte.hpp>
+#include <boost/units/systems/information/bit.hpp>
+#include <boost/units/systems/information/nat.hpp>
+#include <boost/units/systems/information/hartley.hpp>
+#include <boost/units/systems/information/shannon.hpp>
+#include <boost/units/systems/information/prefixes.hpp>
+
+#endif
diff --git a/boost/units/systems/information/bit.hpp b/boost/units/systems/information/bit.hpp
new file mode 100644
index 0000000..5d97118
--- /dev/null
+++ b/boost/units/systems/information/bit.hpp
@@ -0,0 +1,30 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2014 Erik Erlandson
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_INFORMATION_BIT_HPP
+#define BOOST_UNITS_INFORMATION_BIT_HPP
+
+#include <boost/units/systems/information/byte.hpp>
+#include <boost/units/base_units/information/bit.hpp>
+
+namespace boost {
+namespace units {
+namespace information {
+
+namespace hu {
+namespace bit {
+typedef unit<information_dimension, make_system<bit_base_unit>::type> info;
+}}
+
+BOOST_UNITS_STATIC_CONSTANT(bit, hu::bit::info);
+BOOST_UNITS_STATIC_CONSTANT(bits, hu::bit::info);
+
+}}}
+
+#endif
diff --git a/boost/units/systems/information/byte.hpp b/boost/units/systems/information/byte.hpp
new file mode 100644
index 0000000..ac80c41
--- /dev/null
+++ b/boost/units/systems/information/byte.hpp
@@ -0,0 +1,42 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2014 Erik Erlandson
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_INFORMATION_BYTE_HPP
+#define BOOST_UNITS_INFORMATION_BYTE_HPP
+
+#include <boost/units/make_system.hpp>
+#include <boost/units/unit.hpp>
+#include <boost/units/static_constant.hpp>
+
+#include <boost/units/base_units/information/byte.hpp>
+
+namespace boost {
+namespace units {
+namespace information {
+
+typedef make_system<byte_base_unit>::type system;
+
+typedef unit<dimensionless_type, system> dimensionless;
+
+namespace hu {
+namespace byte {
+typedef unit<information_dimension, system> info;
+}}
+
+BOOST_UNITS_STATIC_CONSTANT(byte, hu::byte::info);
+BOOST_UNITS_STATIC_CONSTANT(bytes, hu::byte::info);
+
+// I'm going to define boost::units::information::info (the "default")
+// to be hu::byte::info -- other variants such as hu::bit::info, hu::nat::info, etc
+// must be explicitly referred to
+typedef hu::byte::info info;
+
+}}}
+
+#endif
diff --git a/boost/units/systems/information/hartley.hpp b/boost/units/systems/information/hartley.hpp
new file mode 100644
index 0000000..5701614
--- /dev/null
+++ b/boost/units/systems/information/hartley.hpp
@@ -0,0 +1,30 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2014 Erik Erlandson
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_INFORMATION_HARTLEY_HPP
+#define BOOST_UNITS_INFORMATION_HARTLEY_HPP
+
+#include <boost/units/systems/information/byte.hpp>
+#include <boost/units/base_units/information/hartley.hpp>
+
+namespace boost {
+namespace units {
+namespace information {
+
+namespace hu {
+namespace hartley {
+typedef unit<information_dimension, make_system<hartley_base_unit>::type> info;
+}}
+
+BOOST_UNITS_STATIC_CONSTANT(hartley, hu::hartley::info);
+BOOST_UNITS_STATIC_CONSTANT(hartleys, hu::hartley::info);
+
+}}}
+
+#endif
diff --git a/boost/units/systems/information/nat.hpp b/boost/units/systems/information/nat.hpp
new file mode 100644
index 0000000..f4430d8
--- /dev/null
+++ b/boost/units/systems/information/nat.hpp
@@ -0,0 +1,30 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2014 Erik Erlandson
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_INFORMATION_NAT_HPP
+#define BOOST_UNITS_INFORMATION_NAT_HPP
+
+#include <boost/units/systems/information/byte.hpp>
+#include <boost/units/base_units/information/nat.hpp>
+
+namespace boost {
+namespace units {
+namespace information {
+
+namespace hu {
+namespace nat {
+typedef unit<information_dimension, make_system<nat_base_unit>::type> info;
+}}
+
+BOOST_UNITS_STATIC_CONSTANT(nat, hu::nat::info);
+BOOST_UNITS_STATIC_CONSTANT(nats, hu::nat::info);
+
+}}}
+
+#endif
diff --git a/boost/units/systems/information/prefixes.hpp b/boost/units/systems/information/prefixes.hpp
new file mode 100644
index 0000000..52b1361
--- /dev/null
+++ b/boost/units/systems/information/prefixes.hpp
@@ -0,0 +1,43 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2014 Erik Erlandson
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_INFORMATION_PREFIXES_HPP
+#define BOOST_UNITS_INFORMATION_PREFIXES_HPP
+
+#include <boost/units/make_scaled_unit.hpp>
+#include <boost/units/static_rational.hpp>
+#include <boost/units/scale.hpp>
+
+#include <boost/units/systems/information/byte.hpp>
+
+#define BOOST_UNITS_INFOSYS_PREFIX(exponent, name) \
+ typedef make_scaled_unit<dimensionless, scale<2, static_rational<exponent> > >::type name ## _pf_type; \
+ BOOST_UNITS_STATIC_CONSTANT(name, name ## _pf_type)
+
+namespace boost {
+namespace units {
+namespace information {
+
+// Note, these are defined (somewhat arbitrarily) against the 'byte' system.
+// They work smoothly with bit_information, nat_information, etc, so it is
+// transparent to the user.
+BOOST_UNITS_INFOSYS_PREFIX(10, kibi);
+BOOST_UNITS_INFOSYS_PREFIX(20, mebi);
+BOOST_UNITS_INFOSYS_PREFIX(30, gibi);
+BOOST_UNITS_INFOSYS_PREFIX(40, tebi);
+BOOST_UNITS_INFOSYS_PREFIX(50, pebi);
+BOOST_UNITS_INFOSYS_PREFIX(60, exbi);
+BOOST_UNITS_INFOSYS_PREFIX(70, zebi);
+BOOST_UNITS_INFOSYS_PREFIX(80, yobi);
+
+}}}
+
+#undef BOOST_UNITS_INFOSYS_PREFIX
+
+#endif
diff --git a/boost/units/systems/information/shannon.hpp b/boost/units/systems/information/shannon.hpp
new file mode 100644
index 0000000..a2488fb
--- /dev/null
+++ b/boost/units/systems/information/shannon.hpp
@@ -0,0 +1,30 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2014 Erik Erlandson
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_UNITS_INFORMATION_SHANNON_HPP
+#define BOOST_UNITS_INFORMATION_SHANNON_HPP
+
+#include <boost/units/systems/information/byte.hpp>
+#include <boost/units/base_units/information/shannon.hpp>
+
+namespace boost {
+namespace units {
+namespace information {
+
+namespace hu {
+namespace shannon {
+typedef unit<information_dimension, make_system<shannon_base_unit>::type> info;
+}}
+
+BOOST_UNITS_STATIC_CONSTANT(shannon, hu::shannon::info);
+BOOST_UNITS_STATIC_CONSTANT(shannons, hu::shannon::info);
+
+}}}
+
+#endif
diff --git a/boost/units/systems/si/codata/alpha_constants.hpp b/boost/units/systems/si/codata/alpha_constants.hpp
index 1b1846f..fa6e7f5 100644
--- a/boost/units/systems/si/codata/alpha_constants.hpp
+++ b/boost/units/systems/si/codata/alpha_constants.hpp
@@ -11,6 +11,7 @@
#ifndef BOOST_UNITS_CODATA_ALPHA_CONSTANTS_HPP
#define BOOST_UNITS_CODATA_ALPHA_CONSTANTS_HPP
+#include <boost/units/quantity.hpp>
#include <boost/units/static_constant.hpp>
#include <boost/units/systems/detail/constants.hpp>
diff --git a/boost/units/systems/si/codata/deuteron_constants.hpp b/boost/units/systems/si/codata/deuteron_constants.hpp
index a92b666..167c576 100644
--- a/boost/units/systems/si/codata/deuteron_constants.hpp
+++ b/boost/units/systems/si/codata/deuteron_constants.hpp
@@ -11,6 +11,7 @@
#ifndef BOOST_UNITS_CODATA_DEUTERON_CONSTANTS_HPP
#define BOOST_UNITS_CODATA_DEUTERON_CONSTANTS_HPP
+#include <boost/units/quantity.hpp>
#include <boost/units/static_constant.hpp>
#include <boost/units/systems/detail/constants.hpp>
diff --git a/boost/units/systems/si/codata/electromagnetic_constants.hpp b/boost/units/systems/si/codata/electromagnetic_constants.hpp
index b2ffe26..bad7be5 100644
--- a/boost/units/systems/si/codata/electromagnetic_constants.hpp
+++ b/boost/units/systems/si/codata/electromagnetic_constants.hpp
@@ -18,6 +18,7 @@
/// CODATA 2006 values as of 2007/03/30
///
+#include <boost/units/quantity.hpp>
#include <boost/units/static_constant.hpp>
#include <boost/units/systems/detail/constants.hpp>
diff --git a/boost/units/systems/si/codata/electron_constants.hpp b/boost/units/systems/si/codata/electron_constants.hpp
index 131ba92..4582c79 100644
--- a/boost/units/systems/si/codata/electron_constants.hpp
+++ b/boost/units/systems/si/codata/electron_constants.hpp
@@ -11,6 +11,7 @@
#ifndef BOOST_UNITS_CODATA_ELECTRON_CONSTANTS_HPP
#define BOOST_UNITS_CODATA_ELECTRON_CONSTANTS_HPP
+#include <boost/units/quantity.hpp>
#include <boost/units/static_constant.hpp>
#include <boost/units/systems/detail/constants.hpp>
diff --git a/boost/units/systems/si/codata/helion_constants.hpp b/boost/units/systems/si/codata/helion_constants.hpp
index 56665f3..4e88242 100644
--- a/boost/units/systems/si/codata/helion_constants.hpp
+++ b/boost/units/systems/si/codata/helion_constants.hpp
@@ -11,6 +11,7 @@
#ifndef BOOST_UNITS_CODATA_HELION_CONSTANTS_HPP
#define BOOST_UNITS_CODATA_HELION_CONSTANTS_HPP
+#include <boost/units/quantity.hpp>
#include <boost/units/static_constant.hpp>
#include <boost/units/systems/detail/constants.hpp>
diff --git a/boost/units/systems/si/codata/muon_constants.hpp b/boost/units/systems/si/codata/muon_constants.hpp
index 12afdf1..c580e3c 100644
--- a/boost/units/systems/si/codata/muon_constants.hpp
+++ b/boost/units/systems/si/codata/muon_constants.hpp
@@ -11,6 +11,7 @@
#ifndef BOOST_UNITS_CODATA_MUON_CONSTANTS_HPP
#define BOOST_UNITS_CODATA_MUON_CONSTANTS_HPP
+#include <boost/units/quantity.hpp>
#include <boost/units/static_constant.hpp>
#include <boost/units/systems/detail/constants.hpp>
diff --git a/boost/units/systems/si/codata/neutron_constants.hpp b/boost/units/systems/si/codata/neutron_constants.hpp
index 44d89bc..fb97124 100644
--- a/boost/units/systems/si/codata/neutron_constants.hpp
+++ b/boost/units/systems/si/codata/neutron_constants.hpp
@@ -11,6 +11,7 @@
#ifndef BOOST_UNITS_CODATA_NEUTRON_CONSTANTS_HPP
#define BOOST_UNITS_CODATA_NEUTRON_CONSTANTS_HPP
+#include <boost/units/quantity.hpp>
#include <boost/units/static_constant.hpp>
#include <boost/units/systems/detail/constants.hpp>
diff --git a/boost/units/systems/si/codata/physico-chemical_constants.hpp b/boost/units/systems/si/codata/physico-chemical_constants.hpp
index 0cde3ac..38975bb 100644
--- a/boost/units/systems/si/codata/physico-chemical_constants.hpp
+++ b/boost/units/systems/si/codata/physico-chemical_constants.hpp
@@ -12,6 +12,7 @@
#define BOOST_UNITS_CODATA_PHYSICO_CHEMICAL_CONSTANTS_HPP
#include <boost/units/pow.hpp>
+#include <boost/units/quantity.hpp>
#include <boost/units/static_constant.hpp>
#include <boost/units/systems/detail/constants.hpp>
diff --git a/boost/units/systems/si/codata/proton_constants.hpp b/boost/units/systems/si/codata/proton_constants.hpp
index 14c1ee0..78cce8c 100644
--- a/boost/units/systems/si/codata/proton_constants.hpp
+++ b/boost/units/systems/si/codata/proton_constants.hpp
@@ -11,6 +11,7 @@
#ifndef BOOST_UNITS_CODATA_PROTON_CONSTANTS_HPP
#define BOOST_UNITS_CODATA_PROTON_CONSTANTS_HPP
+#include <boost/units/quantity.hpp>
#include <boost/units/static_constant.hpp>
#include <boost/units/systems/detail/constants.hpp>
diff --git a/boost/units/systems/si/codata/tau_constants.hpp b/boost/units/systems/si/codata/tau_constants.hpp
index 653019e..ea047bc 100644
--- a/boost/units/systems/si/codata/tau_constants.hpp
+++ b/boost/units/systems/si/codata/tau_constants.hpp
@@ -11,6 +11,7 @@
#ifndef BOOST_UNITS_CODATA_TAU_CONSTANTS_HPP
#define BOOST_UNITS_CODATA_TAU_CONSTANTS_HPP
+#include <boost/units/quantity.hpp>
#include <boost/units/static_constant.hpp>
#include <boost/units/systems/detail/constants.hpp>
diff --git a/boost/units/systems/si/codata/triton_constants.hpp b/boost/units/systems/si/codata/triton_constants.hpp
index 24448ab..5866082 100644
--- a/boost/units/systems/si/codata/triton_constants.hpp
+++ b/boost/units/systems/si/codata/triton_constants.hpp
@@ -11,6 +11,7 @@
#ifndef BOOST_UNITS_CODATA_TRITON_CONSTANTS_HPP
#define BOOST_UNITS_CODATA_TRITON_CONSTANTS_HPP
+#include <boost/units/quantity.hpp>
#include <boost/units/static_constant.hpp>
#include <boost/units/systems/detail/constants.hpp>
diff --git a/boost/units/systems/si/codata/universal_constants.hpp b/boost/units/systems/si/codata/universal_constants.hpp
index 21f076b..9aa64c4 100644
--- a/boost/units/systems/si/codata/universal_constants.hpp
+++ b/boost/units/systems/si/codata/universal_constants.hpp
@@ -11,6 +11,7 @@
#ifndef BOOST_UNITS_CODATA_UNIVERSAL_CONSTANTS_HPP
#define BOOST_UNITS_CODATA_UNIVERSAL_CONSTANTS_HPP
+#include <boost/units/quantity.hpp>
#include <boost/units/static_constant.hpp>
#include <boost/units/systems/detail/constants.hpp>
diff --git a/boost/units/units_fwd.hpp b/boost/units/units_fwd.hpp
index e97c46e..cca5c0b 100644
--- a/boost/units/units_fwd.hpp
+++ b/boost/units/units_fwd.hpp
@@ -49,7 +49,7 @@ template<class T> struct is_unit;
template<class T,class Dim> struct is_unit_of_dimension;
template<class T,class System> struct is_unit_of_system;
-template<class Unit,class Y> class quantity;
+template<class Unit,class Y = double> class quantity;
template<class System,class Y> struct dimensionless_quantity;
template<class T> struct is_quantity;