|
Boost-Commit : |
From: boost_at_[hidden]
Date: 2008-05-19 03:36:50
Author: matthiasschabel
Date: 2008-05-19 03:36:47 EDT (Mon, 19 May 2008)
New Revision: 45536
URL: http://svn.boost.org/trac/boost/changeset/45536
Log:
add BIPM official SI symbols from http://www1.bipm.org/en/si/si_brochure/chapter2/2-2/table3.html and some from http://www1.bipm.org/en/si/si_brochure/chapter2/2-2/table4.html
Text files modified:
sandbox/units/boost/units/base_units/astronomical/light_day.hpp | 2 +-
sandbox/units/boost/units/base_units/astronomical/light_hour.hpp | 2 +-
sandbox/units/boost/units/base_units/astronomical/light_minute.hpp | 2 +-
sandbox/units/boost/units/base_units/astronomical/light_second.hpp | 2 +-
sandbox/units/boost/units/systems/si/absorbed_dose.hpp | 9 +++++++++
sandbox/units/boost/units/systems/si/activity.hpp | 9 +++++++++
sandbox/units/boost/units/systems/si/angular_velocity.hpp | 8 ++++++++
sandbox/units/boost/units/systems/si/area.hpp | 3 +++
sandbox/units/boost/units/systems/si/capacitance.hpp | 8 ++++++++
sandbox/units/boost/units/systems/si/catalytic_activity.hpp | 8 ++++++++
sandbox/units/boost/units/systems/si/conductance.hpp | 8 ++++++++
sandbox/units/boost/units/systems/si/dose_equivalent.hpp | 9 +++++++++
sandbox/units/boost/units/systems/si/dynamic_viscosity.hpp | 8 ++++++++
sandbox/units/boost/units/systems/si/electric_charge.hpp | 8 ++++++++
sandbox/units/boost/units/systems/si/electric_potential.hpp | 8 ++++++++
sandbox/units/boost/units/systems/si/energy.hpp | 8 ++++++++
sandbox/units/boost/units/systems/si/force.hpp | 8 ++++++++
sandbox/units/boost/units/systems/si/frequency.hpp | 8 ++++++++
sandbox/units/boost/units/systems/si/illuminance.hpp | 5 +++++
sandbox/units/boost/units/systems/si/inductance.hpp | 8 ++++++++
sandbox/units/boost/units/systems/si/luminous_flux.hpp | 8 ++++++++
sandbox/units/boost/units/systems/si/magnetic_flux.hpp | 5 +++++
sandbox/units/boost/units/systems/si/magnetic_flux_density.hpp | 8 ++++++++
sandbox/units/boost/units/systems/si/permeability.hpp | 8 ++++++++
sandbox/units/boost/units/systems/si/permittivity.hpp | 8 ++++++++
sandbox/units/boost/units/systems/si/power.hpp | 8 ++++++++
sandbox/units/boost/units/systems/si/pressure.hpp | 8 ++++++++
sandbox/units/boost/units/systems/si/resistance.hpp | 8 ++++++++
sandbox/units/boost/units/systems/si/torque.hpp | 33 ++++++++++++++++++++++-----------
sandbox/units/libs/units/example/composite_output.cpp | 8 ++++----
sandbox/units/libs/units/example/kitchen_sink.cpp | 19 +++++++++++++++++++
31 files changed, 233 insertions(+), 19 deletions(-)
Modified: sandbox/units/boost/units/base_units/astronomical/light_day.hpp
==============================================================================
--- sandbox/units/boost/units/base_units/astronomical/light_day.hpp (original)
+++ sandbox/units/boost/units/base_units/astronomical/light_day.hpp 2008-05-19 03:36:47 EDT (Mon, 19 May 2008)
@@ -29,7 +29,7 @@
template<>
struct base_unit_info<astronomical::light_day_base_unit> {
static const char* name() { return("light day"); }
- static const char* symbol() { return("ld"); }
+ static const char* symbol() { return("ldy"); }
};
} // namespace units
Modified: sandbox/units/boost/units/base_units/astronomical/light_hour.hpp
==============================================================================
--- sandbox/units/boost/units/base_units/astronomical/light_hour.hpp (original)
+++ sandbox/units/boost/units/base_units/astronomical/light_hour.hpp 2008-05-19 03:36:47 EDT (Mon, 19 May 2008)
@@ -29,7 +29,7 @@
template<>
struct base_unit_info<astronomical::light_hour_base_unit> {
static const char* name() { return("light hour"); }
- static const char* symbol() { return("lh"); }
+ static const char* symbol() { return("lhr"); }
};
} // namespace units
Modified: sandbox/units/boost/units/base_units/astronomical/light_minute.hpp
==============================================================================
--- sandbox/units/boost/units/base_units/astronomical/light_minute.hpp (original)
+++ sandbox/units/boost/units/base_units/astronomical/light_minute.hpp 2008-05-19 03:36:47 EDT (Mon, 19 May 2008)
@@ -29,7 +29,7 @@
template<>
struct base_unit_info<astronomical::light_minute_base_unit> {
static const char* name() { return("light minute"); }
- static const char* symbol() { return("lm"); }
+ static const char* symbol() { return("lmn"); }
};
} // namespace units
Modified: sandbox/units/boost/units/base_units/astronomical/light_second.hpp
==============================================================================
--- sandbox/units/boost/units/base_units/astronomical/light_second.hpp (original)
+++ sandbox/units/boost/units/base_units/astronomical/light_second.hpp 2008-05-19 03:36:47 EDT (Mon, 19 May 2008)
@@ -14,7 +14,7 @@
#include <boost/units/conversion.hpp>
#include <boost/units/base_units/si/meter.hpp>
-BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(astronomical, light_second, "light second", "ls", 2.99792458e8, boost::units::si::meter_base_unit, -201);
+BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(astronomical, light_second, "light second", "lsc", 2.99792458e8, boost::units::si::meter_base_unit, -201);
#if BOOST_UNITS_HAS_BOOST_TYPEOF
Modified: sandbox/units/boost/units/systems/si/absorbed_dose.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/absorbed_dose.hpp (original)
+++ sandbox/units/boost/units/systems/si/absorbed_dose.hpp 2008-05-19 03:36:47 EDT (Mon, 19 May 2008)
@@ -11,6 +11,9 @@
#ifndef BOOST_UNITS_SI_ABSORBED_DOSE_HPP
#define BOOST_UNITS_SI_ABSORBED_DOSE_HPP
+//#include <iostream>
+//#include <boost/units/io.hpp>
+
#include <boost/units/systems/si/base.hpp>
#include <boost/units/physical_dimensions/absorbed_dose.hpp>
@@ -27,6 +30,12 @@
} // namespace si
+// Gy and Sv are dimensionally indistinguishable
+//std::ostream& operator<<(std::ostream& os, const boost::units::si::absorbed_dose&)
+//{
+// return(os << "Gy");
+//}
+
} // namespace units
} // namespace boost
Modified: sandbox/units/boost/units/systems/si/activity.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/activity.hpp (original)
+++ sandbox/units/boost/units/systems/si/activity.hpp 2008-05-19 03:36:47 EDT (Mon, 19 May 2008)
@@ -11,6 +11,9 @@
#ifndef BOOST_UNITS_SI_ACTIVITY_HPP
#define BOOST_UNITS_SI_ACTIVITY_HPP
+//#include <iostream>
+//#include <boost/units/io.hpp>
+
#include <boost/units/systems/si/base.hpp>
#include <boost/units/physical_dimensions/activity.hpp>
@@ -27,6 +30,12 @@
} // namespace si
+// activity is dimensionally indistinguishable from frequency
+//std::ostream& operator<<(std::ostream& os, const boost::units::si::activity&)
+//{
+// return(os << "Bq");
+//}
+
} // namespace units
} // namespace boost
Modified: sandbox/units/boost/units/systems/si/angular_velocity.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/angular_velocity.hpp (original)
+++ sandbox/units/boost/units/systems/si/angular_velocity.hpp 2008-05-19 03:36:47 EDT (Mon, 19 May 2008)
@@ -11,6 +11,9 @@
#ifndef BOOST_UNITS_SI_ANGULAR_VELOCITY_HPP
#define BOOST_UNITS_SI_ANGULAR_VELOCITY_HPP
+#include <iostream>
+#include <boost/units/io.hpp>
+
#include <boost/units/systems/si/base.hpp>
#include <boost/units/physical_dimensions/angular_velocity.hpp>
@@ -27,6 +30,11 @@
} // namespace si
+std::ostream& operator<<(std::ostream& os, const boost::units::si::angular_velocity&)
+{
+ return(os << "rad/s");
+}
+
} // namespace units
} // namespace boost
Modified: sandbox/units/boost/units/systems/si/area.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/area.hpp (original)
+++ sandbox/units/boost/units/systems/si/area.hpp 2008-05-19 03:36:47 EDT (Mon, 19 May 2008)
@@ -11,6 +11,9 @@
#ifndef BOOST_UNITS_SI_AREA_HPP
#define BOOST_UNITS_SI_AREA_HPP
+#include <iostream>
+#include <boost/units/io.hpp>
+
#include <boost/units/systems/si/base.hpp>
#include <boost/units/physical_dimensions/area.hpp>
Modified: sandbox/units/boost/units/systems/si/capacitance.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/capacitance.hpp (original)
+++ sandbox/units/boost/units/systems/si/capacitance.hpp 2008-05-19 03:36:47 EDT (Mon, 19 May 2008)
@@ -11,6 +11,9 @@
#ifndef BOOST_UNITS_SI_CAPACITANCE_HPP
#define BOOST_UNITS_SI_CAPACITANCE_HPP
+#include <iostream>
+#include <boost/units/io.hpp>
+
#include <boost/units/derived_dimension.hpp>
#include <boost/units/systems/si/base.hpp>
@@ -30,6 +33,11 @@
} // namespace si
+std::ostream& operator<<(std::ostream& os, const boost::units::si::capacitance&)
+{
+ return(os << "F");
+}
+
} // namespace units
} // namespace boost
Modified: sandbox/units/boost/units/systems/si/catalytic_activity.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/catalytic_activity.hpp (original)
+++ sandbox/units/boost/units/systems/si/catalytic_activity.hpp 2008-05-19 03:36:47 EDT (Mon, 19 May 2008)
@@ -11,6 +11,9 @@
#ifndef BOOST_UNITS_SI_CATALYTIC_ACTIVITY_HPP
#define BOOST_UNITS_SI_CATALYTIC_ACTIVITY_HPP
+#include <iostream>
+#include <boost/units/io.hpp>
+
#include <boost/units/derived_dimension.hpp>
#include <boost/units/systems/si/base.hpp>
@@ -30,6 +33,11 @@
} // namespace si
+std::ostream& operator<<(std::ostream& os, const boost::units::si::catalytic_activity&)
+{
+ return(os << "kat");
+}
+
} // namespace units
} // namespace boost
Modified: sandbox/units/boost/units/systems/si/conductance.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/conductance.hpp (original)
+++ sandbox/units/boost/units/systems/si/conductance.hpp 2008-05-19 03:36:47 EDT (Mon, 19 May 2008)
@@ -11,6 +11,9 @@
#ifndef BOOST_UNITS_SI_CONDUCTANCE_HPP
#define BOOST_UNITS_SI_CONDUCTANCE_HPP
+#include <iostream>
+#include <boost/units/io.hpp>
+
#include <boost/units/derived_dimension.hpp>
#include <boost/units/systems/si/base.hpp>
@@ -32,6 +35,11 @@
} // namespace si
+std::ostream& operator<<(std::ostream& os, const boost::units::si::conductance&)
+{
+ return(os << "S");
+}
+
} // namespace units
} // namespace boost
Modified: sandbox/units/boost/units/systems/si/dose_equivalent.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/dose_equivalent.hpp (original)
+++ sandbox/units/boost/units/systems/si/dose_equivalent.hpp 2008-05-19 03:36:47 EDT (Mon, 19 May 2008)
@@ -11,6 +11,9 @@
#ifndef BOOST_UNITS_SI_DOSE_EQUIVALENT_HPP
#define BOOST_UNITS_SI_DOSE_EQUIVALENT_HPP
+//#include <iostream>
+//#include <boost/units/io.hpp>
+
#include <boost/units/systems/si/base.hpp>
#include <boost/units/physical_dimensions/dose_equivalent.hpp>
@@ -27,6 +30,12 @@
} // namespace si
+// Gy and Sv are dimensionally indistinguishable
+//std::ostream& operator<<(std::ostream& os, const boost::units::si::dose_equivalent&)
+//{
+// return(os << "Sv");
+//}
+
} // namespace units
} // namespace boost
Modified: sandbox/units/boost/units/systems/si/dynamic_viscosity.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/dynamic_viscosity.hpp (original)
+++ sandbox/units/boost/units/systems/si/dynamic_viscosity.hpp 2008-05-19 03:36:47 EDT (Mon, 19 May 2008)
@@ -11,6 +11,9 @@
#ifndef BOOST_UNITS_SI_DYNAMIC_VISCOSITY_HPP
#define BOOST_UNITS_SI_DYNAMIC_VISCOSITY_HPP
+#include <iostream>
+#include <boost/units/io.hpp>
+
#include <boost/units/systems/si/base.hpp>
#include <boost/units/physical_dimensions/dynamic_viscosity.hpp>
@@ -24,6 +27,11 @@
} // namespace si
+std::ostream& operator<<(std::ostream& os, const boost::units::si::dynamic_viscosity&)
+{
+ return(os << "Pa s");
+}
+
} // namespace units
} // namespace boost
Modified: sandbox/units/boost/units/systems/si/electric_charge.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/electric_charge.hpp (original)
+++ sandbox/units/boost/units/systems/si/electric_charge.hpp 2008-05-19 03:36:47 EDT (Mon, 19 May 2008)
@@ -11,6 +11,9 @@
#ifndef BOOST_UNITS_SI_ELECTRIC_CHARGE_HPP
#define BOOST_UNITS_SI_ELECTRIC_CHARGE_HPP
+#include <iostream>
+#include <boost/units/io.hpp>
+
#include <boost/units/derived_dimension.hpp>
#include <boost/units/systems/si/base.hpp>
@@ -30,6 +33,11 @@
} // namespace si
+std::ostream& operator<<(std::ostream& os, const boost::units::si::electric_charge&)
+{
+ return(os << "C");
+}
+
} // namespace units
} // namespace boost
Modified: sandbox/units/boost/units/systems/si/electric_potential.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/electric_potential.hpp (original)
+++ sandbox/units/boost/units/systems/si/electric_potential.hpp 2008-05-19 03:36:47 EDT (Mon, 19 May 2008)
@@ -11,6 +11,9 @@
#ifndef BOOST_UNITS_SI_ELECTRIC_POTENTIAL_HPP
#define BOOST_UNITS_SI_ELECTRIC_POTENTIAL_HPP
+#include <iostream>
+#include <boost/units/io.hpp>
+
#include <boost/units/derived_dimension.hpp>
#include <boost/units/systems/si/base.hpp>
@@ -30,6 +33,11 @@
} // namespace si
+std::ostream& operator<<(std::ostream& os, const boost::units::si::electric_potential&)
+{
+ return(os << "V");
+}
+
} // namespace units
} // namespace boost
Modified: sandbox/units/boost/units/systems/si/energy.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/energy.hpp (original)
+++ sandbox/units/boost/units/systems/si/energy.hpp 2008-05-19 03:36:47 EDT (Mon, 19 May 2008)
@@ -11,6 +11,9 @@
#ifndef BOOST_UNITS_SI_ENERGY_HPP
#define BOOST_UNITS_SI_ENERGY_HPP
+#include <iostream>
+#include <boost/units/io.hpp>
+
#include <boost/units/systems/si/base.hpp>
#include <boost/units/physical_dimensions/energy.hpp>
@@ -27,6 +30,11 @@
} // namespace si
+std::ostream& operator<<(std::ostream& os, const boost::units::si::energy&)
+{
+ return(os << "J");
+}
+
} // namespace units
} // namespace boost
Modified: sandbox/units/boost/units/systems/si/force.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/force.hpp (original)
+++ sandbox/units/boost/units/systems/si/force.hpp 2008-05-19 03:36:47 EDT (Mon, 19 May 2008)
@@ -11,6 +11,9 @@
#ifndef BOOST_UNITS_SI_FORCE_HPP
#define BOOST_UNITS_SI_FORCE_HPP
+#include <iostream>
+#include <boost/units/io.hpp>
+
#include <boost/units/systems/si/base.hpp>
#include <boost/units/physical_dimensions/force.hpp>
@@ -27,6 +30,11 @@
} // namespace si
+std::ostream& operator<<(std::ostream& os, const boost::units::si::force&)
+{
+ return(os << "N");
+}
+
} // namespace units
} // namespace boost
Modified: sandbox/units/boost/units/systems/si/frequency.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/frequency.hpp (original)
+++ sandbox/units/boost/units/systems/si/frequency.hpp 2008-05-19 03:36:47 EDT (Mon, 19 May 2008)
@@ -11,6 +11,9 @@
#ifndef BOOST_UNITS_SI_FREQUENCY_HPP
#define BOOST_UNITS_SI_FREQUENCY_HPP
+#include <iostream>
+#include <boost/units/io.hpp>
+
#include <boost/units/systems/si/base.hpp>
#include <boost/units/physical_dimensions/frequency.hpp>
@@ -26,6 +29,11 @@
} // namespace si
+std::ostream& operator<<(std::ostream& os, const boost::units::si::frequency&)
+{
+ return(os << "Hz");
+}
+
} // namespace units
} // namespace boost
Modified: sandbox/units/boost/units/systems/si/illuminance.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/illuminance.hpp (original)
+++ sandbox/units/boost/units/systems/si/illuminance.hpp 2008-05-19 03:36:47 EDT (Mon, 19 May 2008)
@@ -26,6 +26,11 @@
} // namespace si
+std::ostream& operator<<(std::ostream& os, const boost::units::si::illuminance&)
+{
+ return(os << "lx");
+}
+
} // namespace units
} // namespace boost
Modified: sandbox/units/boost/units/systems/si/inductance.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/inductance.hpp (original)
+++ sandbox/units/boost/units/systems/si/inductance.hpp 2008-05-19 03:36:47 EDT (Mon, 19 May 2008)
@@ -11,6 +11,9 @@
#ifndef BOOST_UNITS_SI_INDUCTANCE_HPP
#define BOOST_UNITS_SI_INDUCTANCE_HPP
+#include <iostream>
+#include <boost/units/io.hpp>
+
#include <boost/units/derived_dimension.hpp>
#include <boost/units/systems/si/base.hpp>
@@ -30,6 +33,11 @@
} // namespace si
+std::ostream& operator<<(std::ostream& os, const boost::units::si::inductance&)
+{
+ return(os << "H");
+}
+
} // namespace units
} // namespace boost
Modified: sandbox/units/boost/units/systems/si/luminous_flux.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/luminous_flux.hpp (original)
+++ sandbox/units/boost/units/systems/si/luminous_flux.hpp 2008-05-19 03:36:47 EDT (Mon, 19 May 2008)
@@ -11,6 +11,9 @@
#ifndef BOOST_UNITS_SI_LUMINOUS_FLUX_HPP
#define BOOST_UNITS_SI_LUMINOUS_FLUX_HPP
+#include <iostream>
+#include <boost/units/io.hpp>
+
#include <boost/units/systems/si/base.hpp>
#include <boost/units/physical_dimensions/luminous_flux.hpp>
@@ -27,6 +30,11 @@
} // namespace si
+std::ostream& operator<<(std::ostream& os, const boost::units::si::luminous_flux&)
+{
+ return(os << "lm");
+}
+
} // namespace units
} // namespace boost
Modified: sandbox/units/boost/units/systems/si/magnetic_flux.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/magnetic_flux.hpp (original)
+++ sandbox/units/boost/units/systems/si/magnetic_flux.hpp 2008-05-19 03:36:47 EDT (Mon, 19 May 2008)
@@ -30,6 +30,11 @@
} // namespace si
+std::ostream& operator<<(std::ostream& os, const boost::units::si::magnetic_flux&)
+{
+ return(os << "Wb");
+}
+
} // namespace units
} // namespace boost
Modified: sandbox/units/boost/units/systems/si/magnetic_flux_density.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/magnetic_flux_density.hpp (original)
+++ sandbox/units/boost/units/systems/si/magnetic_flux_density.hpp 2008-05-19 03:36:47 EDT (Mon, 19 May 2008)
@@ -11,6 +11,9 @@
#ifndef BOOST_UNITS_SI_MAGNETIC_FLUX_DENSITY_HPP
#define BOOST_UNITS_SI_MAGNETIC_FLUX_DENSITY_HPP
+#include <iostream>
+#include <boost/units/io.hpp>
+
#include <boost/units/derived_dimension.hpp>
#include <boost/units/systems/si/base.hpp>
@@ -30,6 +33,11 @@
} // namespace si
+std::ostream& operator<<(std::ostream& os, const boost::units::si::magnetic_flux_density&)
+{
+ return(os << "T");
+}
+
} // namespace units
} // namespace boost
Modified: sandbox/units/boost/units/systems/si/permeability.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/permeability.hpp (original)
+++ sandbox/units/boost/units/systems/si/permeability.hpp 2008-05-19 03:36:47 EDT (Mon, 19 May 2008)
@@ -11,6 +11,9 @@
#ifndef BOOST_UNITS_SI_PERMEABILITY_HPP
#define BOOST_UNITS_SI_PERMEABILITY_HPP
+#include <iostream>
+#include <boost/units/io.hpp>
+
#include <boost/units/derived_dimension.hpp>
#include <boost/units/systems/si/base.hpp>
@@ -27,6 +30,11 @@
} // namespace si
+std::ostream& operator<<(std::ostream& os, const boost::units::si::permeability&)
+{
+ return(os << "H/m");
+}
+
} // namespace units
} // namespace boost
Modified: sandbox/units/boost/units/systems/si/permittivity.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/permittivity.hpp (original)
+++ sandbox/units/boost/units/systems/si/permittivity.hpp 2008-05-19 03:36:47 EDT (Mon, 19 May 2008)
@@ -11,6 +11,9 @@
#ifndef BOOST_UNITS_SI_PERMITTIVITY_HPP
#define BOOST_UNITS_SI_PERMITTIVITY_HPP
+#include <iostream>
+#include <boost/units/io.hpp>
+
#include <boost/units/derived_dimension.hpp>
#include <boost/units/systems/si/base.hpp>
@@ -27,6 +30,11 @@
} // namespace si
+std::ostream& operator<<(std::ostream& os, const boost::units::si::permittivity&)
+{
+ return(os << "F/m");
+}
+
} // namespace units
} // namespace boost
Modified: sandbox/units/boost/units/systems/si/power.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/power.hpp (original)
+++ sandbox/units/boost/units/systems/si/power.hpp 2008-05-19 03:36:47 EDT (Mon, 19 May 2008)
@@ -11,6 +11,9 @@
#ifndef BOOST_UNITS_SI_POWER_HPP
#define BOOST_UNITS_SI_POWER_HPP
+#include <iostream>
+#include <boost/units/io.hpp>
+
#include <boost/units/systems/si/base.hpp>
#include <boost/units/physical_dimensions/power.hpp>
@@ -27,6 +30,11 @@
} // namespace si
+std::ostream& operator<<(std::ostream& os, const boost::units::si::power&)
+{
+ return(os << "W");
+}
+
} // namespace units
} // namespace boost
Modified: sandbox/units/boost/units/systems/si/pressure.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/pressure.hpp (original)
+++ sandbox/units/boost/units/systems/si/pressure.hpp 2008-05-19 03:36:47 EDT (Mon, 19 May 2008)
@@ -11,6 +11,9 @@
#ifndef BOOST_UNITS_SI_PRESSURE_HPP
#define BOOST_UNITS_SI_PRESSURE_HPP
+#include <iostream>
+#include <boost/units/io.hpp>
+
#include <boost/units/systems/si/base.hpp>
#include <boost/units/physical_dimensions/pressure.hpp>
@@ -42,6 +45,11 @@
} // namespace si
+std::ostream& operator<<(std::ostream& os, const boost::units::si::pressure&)
+{
+ return(os << "Pa");
+}
+
} // namespace units
} // namespace boost
Modified: sandbox/units/boost/units/systems/si/resistance.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/resistance.hpp (original)
+++ sandbox/units/boost/units/systems/si/resistance.hpp 2008-05-19 03:36:47 EDT (Mon, 19 May 2008)
@@ -11,6 +11,9 @@
#ifndef BOOST_UNITS_SI_RESISTANCE_HPP
#define BOOST_UNITS_SI_RESISTANCE_HPP
+#include <iostream>
+#include <boost/units/io.hpp>
+
#include <boost/units/derived_dimension.hpp>
#include <boost/units/systems/si/base.hpp>
@@ -30,6 +33,11 @@
} // namespace si
+std::ostream& operator<<(std::ostream& os, const boost::units::si::resistance&)
+{
+ return(os << "ohm");
+}
+
} // namespace units
} // namespace boost
Modified: sandbox/units/boost/units/systems/si/torque.hpp
==============================================================================
--- sandbox/units/boost/units/systems/si/torque.hpp (original)
+++ sandbox/units/boost/units/systems/si/torque.hpp 2008-05-19 03:36:47 EDT (Mon, 19 May 2008)
@@ -8,24 +8,35 @@
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
-#ifndef BOOST_UNITS_TORQUE_DERIVED_DIMENSION_HPP
-#define BOOST_UNITS_TORQUE_DERIVED_DIMENSION_HPP
+#ifndef BOOST_UNITS_SI_TORQUE_HPP
+#define BOOST_UNITS_SI_TORQUE_HPP
-#include <boost/units/derived_dimension.hpp>
-#include <boost/units/physical_dimensions/length.hpp>
-#include <boost/units/physical_dimensions/mass.hpp>
-#include <boost/units/physical_dimensions/plane_angle.hpp>
-#include <boost/units/physical_dimensions/time.hpp>
+#include <iostream>
+#include <boost/units/io.hpp>
+
+#include <boost/units/systems/si/base.hpp>
+#include <boost/units/physical_dimensions/torque.hpp>
namespace boost {
-namespace units {
+namespace units {
+
+namespace si {
+
+typedef unit<torque_dimension,si::system> torque;
+
+BOOST_UNITS_STATIC_CONSTANT(newton_meter,torque);
+BOOST_UNITS_STATIC_CONSTANT(newton_meters,torque);
+
+} // namespace si
-/// derived dimension for force : L M T^-2 QP^-1
-typedef derived_dimension<length_base_dimension,1,mass_base_dimension,1,time_base_dimension,-2,plane_angle_base_dimension,-1>::type torque_dimension;
+std::ostream& operator<<(std::ostream& os, const boost::units::si::torque&)
+{
+ return(os << "N m");
+}
} // namespace units
} // namespace boost
-#endif // BOOST_UNITS_TORQUE_DERIVED_DIMENSION_HPP
+#endif // BOOST_UNITS_SI_TORQUE_HPP
Modified: sandbox/units/libs/units/example/composite_output.cpp
==============================================================================
--- sandbox/units/libs/units/example/composite_output.cpp (original)
+++ sandbox/units/libs/units/example/composite_output.cpp 2008-05-19 03:36:47 EDT (Mon, 19 May 2008)
@@ -9,7 +9,7 @@
// http://www.boost.org/LICENSE_1_0.txt)
#include <boost/units/quantity.hpp>
-#include <boost/units/systems/si.hpp>
+#include <boost/units/systems/cgs.hpp>
#include <boost/units/io.hpp>
#include <iostream>
@@ -19,8 +19,8 @@
//[composite_output_snippet_1
-std::ostream& operator<<(std::ostream& os, const boost::units::si::force&) {
- return(os << "N");
+std::ostream& operator<<(std::ostream& os, const boost::units::cgs::force&) {
+ return(os << "dyn");
}
//]
@@ -30,5 +30,5 @@
}
int main() {
- std::cout << 2.0 * boost::units::si::newton << std::endl;
+ std::cout << 2.0 * boost::units::cgs::dyne << std::endl;
}
Modified: sandbox/units/libs/units/example/kitchen_sink.cpp
==============================================================================
--- sandbox/units/libs/units/example/kitchen_sink.cpp (original)
+++ sandbox/units/libs/units/example/kitchen_sink.cpp 2008-05-19 03:36:47 EDT (Mon, 19 May 2008)
@@ -427,6 +427,25 @@
<< "w/(u*x)^(1/2) = " << w/pow< static_rational<1,2> >(u*x)
<< std::endl << std::endl;
}
+
+ std::cout << quantity<capacitance>(1.0*farad) << std::endl
+ << quantity<catalytic_activity>(1.0*katal) << std::endl
+ << quantity<conductance>(1.0*siemen) << std::endl
+ << quantity<electric_charge>(1.0*coulomb) << std::endl
+ << quantity<electric_potential>(1.0*volt) << std::endl
+ << quantity<energy>(1.0*joule) << std::endl
+ << quantity<force>(1.0*newton) << std::endl
+ << quantity<frequency>(1.0*hertz) << std::endl
+ << quantity<illuminance>(1.0*lux) << std::endl
+ << quantity<inductance>(1.0*henry) << std::endl
+ << quantity<luminous_flux>(1.0*lumen) << std::endl
+ << quantity<magnetic_flux>(1.0*weber) << std::endl
+ << quantity<magnetic_flux_density>(1.0*tesla) << std::endl
+ << quantity<power>(1.0*watt) << std::endl
+ << quantity<pressure>(1.0*pascals) << std::endl
+ << quantity<resistance>(1.0*ohm) << std::endl
+ << quantity<torque>(1.0*newton_meters) << std::endl
+ << std::endl;
sstream2 << "S1 : 2" << std::endl;
sstream2 << "X1 : 2" << std::endl;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk