Added boost header

This commit is contained in:
Christophe Riccio
2012-01-08 01:26:07 +00:00
parent 9c3faaca40
commit c7d752cdf8
8946 changed files with 1732316 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
// Copyright (C) 2007-2008 Steven Watanabe
//
// 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_BASE_UNITS_US_CUP_HPP_INCLUDED
#define BOOST_UNITS_BASE_UNITS_US_CUP_HPP_INCLUDED
#include <boost/units/scaled_base_unit.hpp>
#include <boost/units/static_rational.hpp>
#include <boost/units/scale.hpp>
#include <boost/units/base_units/us/pint.hpp>
namespace boost {
namespace units {
namespace us {
typedef scaled_base_unit<pint_base_unit, scale<2, static_rational<-1> > > cup_base_unit;
} // namespace us
template<>
struct base_unit_info<us::cup_base_unit> {
static const char* name() { return("cup"); }
static const char* symbol() { return("c"); }
};
} // namespace units
} // namespace boost
#endif // BOOST_UNITS_BASE_UNITS_US_CUP_HPP_INCLUDED

View File

@@ -0,0 +1,39 @@
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
// Copyright (C) 2007-2008 Steven Watanabe
//
// 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_BASE_UNITS_US_DRAM_HPP_INCLUDED
#define BOOST_UNIT_BASE_UNITS_US_DRAM_HPP_INCLUDED
#include <boost/units/scaled_base_unit.hpp>
#include <boost/units/static_rational.hpp>
#include <boost/units/scale.hpp>
#include <boost/units/base_units/us/pound.hpp>
namespace boost {
namespace units {
namespace us {
typedef scaled_base_unit<pound_base_unit, scale<16, static_rational<-2> > > dram_base_unit;
} // namespace us
template<>
struct base_unit_info<us::dram_base_unit> {
static const char* name() { return("dram (U.S.)"); }
static const char* symbol() { return("dr"); }
};
} // namespace units
} // namespace boost
#endif // BOOST_UNIT_BASE_UNITS_US_DRAM_HPP_INCLUDED

View File

@@ -0,0 +1,39 @@
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
// Copyright (C) 2007-2008 Steven Watanabe
//
// 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_BASE_UNITS_US_FLUID_DRAM_HPP_INCLUDED
#define BOOST_UNITS_BASE_UNITS_US_FLUID_DRAM_HPP_INCLUDED
#include <boost/units/scaled_base_unit.hpp>
#include <boost/units/static_rational.hpp>
#include <boost/units/scale.hpp>
#include <boost/units/base_units/us/pint.hpp>
namespace boost {
namespace units {
namespace us {
typedef scaled_base_unit<pint_base_unit, scale<2, static_rational<-7> > > fluid_dram_base_unit;
} // namespace us
template<>
struct base_unit_info<us::fluid_dram_base_unit> {
static const char* name() { return("fluid dram (U.S.)"); }
static const char* symbol() { return("fl dr"); }
};
} // namespace units
} // namespace boost
#endif // BOOST_UNITS_BASE_UNITS_US_FLUID_DRAM_HPP_INCLUDED

View File

@@ -0,0 +1,39 @@
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
// Copyright (C) 2007-2008 Steven Watanabe
//
// 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_BASE_UNITS_US_FLUID_OUNCE_HPP_INCLUDED
#define BOOST_UNITS_BASE_UNITS_US_FLUID_OUNCE_HPP_INCLUDED
#include <boost/units/scaled_base_unit.hpp>
#include <boost/units/static_rational.hpp>
#include <boost/units/scale.hpp>
#include <boost/units/base_units/us/pint.hpp>
namespace boost {
namespace units {
namespace us {
typedef scaled_base_unit<pint_base_unit, scale<16, static_rational<-1> > > fluid_ounce_base_unit;
} // namespace us
template<>
struct base_unit_info<us::fluid_ounce_base_unit> {
static const char* name() { return("fluid ounce (U.S.)"); }
static const char* symbol() { return("fl oz"); }
};
} // namespace units
} // namespace boost
#endif // BOOST_UNITS_BASE_UNITS_US_FLUID_OUNCE_HPP_INCLUDED

View File

@@ -0,0 +1,39 @@
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
// Copyright (C) 2007-2008 Steven Watanabe
//
// 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_US_FOOT_BASE_UNIT_HPP
#define BOOST_UNITS_US_FOOT_BASE_UNIT_HPP
#include <boost/units/scaled_base_unit.hpp>
#include <boost/units/static_rational.hpp>
#include <boost/units/scale.hpp>
#include <boost/units/base_units/us/yard.hpp>
namespace boost {
namespace units {
namespace us {
typedef scaled_base_unit<yard_base_unit, scale<3, static_rational<-1> > > foot_base_unit;
} // namespace us
template<>
struct base_unit_info<us::foot_base_unit> {
static const char* name() { return("foot"); }
static const char* symbol() { return("ft"); }
};
} // namespace units
} // namespace boost
#endif // BOOST_UNITS_US_FOOT_BASE_UNIT_HPP

View File

@@ -0,0 +1,39 @@
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
// Copyright (C) 2007-2008 Steven Watanabe
//
// 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_BASE_UNITS_US_GALLON_HPP_INCLUDED
#define BOOST_UNITS_BASE_UNITS_US_GALLON_HPP_INCLUDED
#include <boost/units/scaled_base_unit.hpp>
#include <boost/units/static_rational.hpp>
#include <boost/units/scale.hpp>
#include <boost/units/base_units/us/pint.hpp>
namespace boost {
namespace units {
namespace us {
typedef scaled_base_unit<pint_base_unit, scale<2, static_rational<3> > > gallon_base_unit;
} // namespace us
template<>
struct base_unit_info<us::gallon_base_unit> {
static const char* name() { return("gallon (U.S.)"); }
static const char* symbol() { return("gal"); }
};
} // namespace units
} // namespace boost
#endif // BOOST_UNITS_BASE_UNITS_US_GALLON_HPP_INCLUDED

View File

@@ -0,0 +1,39 @@
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
// Copyright (C) 2007-2008 Steven Watanabe
//
// 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_BASE_UNITS_US_GILL_HPP_INCLUDED
#define BOOST_UNITS_BASE_UNITS_US_GILL_HPP_INCLUDED
#include <boost/units/scaled_base_unit.hpp>
#include <boost/units/static_rational.hpp>
#include <boost/units/scale.hpp>
#include <boost/units/base_units/us/pint.hpp>
namespace boost {
namespace units {
namespace us {
typedef scaled_base_unit<pint_base_unit, scale<2, static_rational<-2> > > gill_base_unit;
} // namespace us
template<>
struct base_unit_info<us::gill_base_unit> {
static const char* name() { return("gill (U.S.)"); }
static const char* symbol() { return("gi"); }
};
} // namespace units
} // namespace boost
#endif // BOOST_UNITS_BASE_UNITS_US_GILL_HPP_INCLUDED

View File

@@ -0,0 +1,39 @@
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
// Copyright (C) 2007-2008 Steven Watanabe
//
// 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_BASE_UNITS_US_GRAIN_HPP_INCLUDED
#define BOOST_UNIT_BASE_UNITS_US_GRAIN_HPP_INCLUDED
#include <boost/units/scaled_base_unit.hpp>
#include <boost/units/static_rational.hpp>
#include <boost/units/scale.hpp>
#include <boost/units/base_units/us/pound.hpp>
namespace boost {
namespace units {
namespace us {
typedef scaled_base_unit<pound_base_unit, scale<7000, static_rational<-1> > > grain_base_unit;
} // namespace us
template<>
struct base_unit_info<us::grain_base_unit> {
static const char* name() { return("grain"); }
static const char* symbol() { return("gr"); }
};
} // namespace units
} // namespace boost
#endif // BOOST_UNIT_BASE_UNITS_US_GRAIN_HPP_INCLUDED

View File

@@ -0,0 +1,40 @@
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
// Copyright (C) 2007-2008 Steven Watanabe
//
// 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_BASE_UNITS_US_HUNDREDWEIGHT_HPP_INCLUDED
#define BOOST_UNIT_BASE_UNITS_US_HUNDREDWEIGHT_HPP_INCLUDED
#include <boost/units/scaled_base_unit.hpp>
#include <boost/units/static_rational.hpp>
#include <boost/units/scale.hpp>
#include <boost/units/base_units/us/pound.hpp>
namespace boost {
namespace units {
namespace us {
//typedef scaled_base_unit<pound_base_unit, scale<10, static_rational<2> > > hundredweight_base_unit;
typedef scaled_base_unit<pound_base_unit, scale<100, static_rational<1> > > hundredweight_base_unit;
} // namespace us
template<>
struct base_unit_info<us::hundredweight_base_unit> {
static const char* name() { return("hundredweight (U.S.)"); }
static const char* symbol() { return("cwt"); }
};
} // namespace units
} // namespace boost
#endif // BOOST_UNIT_BASE_UNITS_US_HUNDREDWEIGHT_HPP_INCLUDED

View File

@@ -0,0 +1,39 @@
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
// Copyright (C) 2007-2008 Steven Watanabe
//
// 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_US_INCH_BASE_UNIT_HPP
#define BOOST_UNITS_US_INCH_BASE_UNIT_HPP
#include <boost/units/scaled_base_unit.hpp>
#include <boost/units/static_rational.hpp>
#include <boost/units/scale.hpp>
#include <boost/units/base_units/us/yard.hpp>
namespace boost {
namespace units {
namespace us {
typedef scaled_base_unit<yard_base_unit, scale<36, static_rational<-1> > > inch_base_unit;
} // namespace us
template<>
struct base_unit_info<us::inch_base_unit> {
static const char* name() { return("inch"); }
static const char* symbol() { return("in"); }
};
} // namespace units
} // namespace boost
#endif // BOOST_UNITS_US_INCH_BASE_UNIT_HPP

View File

@@ -0,0 +1,39 @@
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
// Copyright (C) 2007-2008 Steven Watanabe
//
// 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_US_MIL_BASE_UNIT_HPP
#define BOOST_UNITS_US_MIL_BASE_UNIT_HPP
#include <boost/units/scaled_base_unit.hpp>
#include <boost/units/static_rational.hpp>
#include <boost/units/scale.hpp>
#include <boost/units/base_units/us/yard.hpp>
namespace boost {
namespace units {
namespace us {
typedef scaled_base_unit<yard_base_unit, scale<36000, static_rational<-1> > > mil_base_unit;
} // namespace us
template<>
struct base_unit_info<us::mil_base_unit> {
static const char* name() { return("mil"); }
static const char* symbol() { return("mil"); }
};
} // namespace units
} // namespace boost
#endif // BOOST_UNITS_US_MIL_BASE_UNIT_HPP

View File

@@ -0,0 +1,39 @@
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
// Copyright (C) 2007-2008 Steven Watanabe
//
// 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_US_MILE_BASE_UNIT_HPP
#define BOOST_UNITS_US_MILE_BASE_UNIT_HPP
#include <boost/units/scaled_base_unit.hpp>
#include <boost/units/static_rational.hpp>
#include <boost/units/scale.hpp>
#include <boost/units/base_units/us/yard.hpp>
namespace boost {
namespace units {
namespace us {
typedef scaled_base_unit<yard_base_unit, scale<1760, static_rational<1> > > mile_base_unit;
} // namespace us
template<>
struct base_unit_info<us::mile_base_unit> {
static const char* name() { return("mile"); }
static const char* symbol() { return("mi"); }
};
} // namespace units
} // namespace boost
#endif // BOOST_UNITS_US_MILE_BASE_UNIT_HPP

View File

@@ -0,0 +1,39 @@
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
// Copyright (C) 2007-2008 Steven Watanabe
//
// 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_BASE_UNITS_US_MINIM_HPP_INCLUDED
#define BOOST_UNITS_BASE_UNITS_US_MINIM_HPP_INCLUDED
#include <boost/units/scaled_base_unit.hpp>
#include <boost/units/static_rational.hpp>
#include <boost/units/scale.hpp>
#include <boost/units/base_units/us/pint.hpp>
namespace boost {
namespace units {
namespace us {
typedef scaled_base_unit<pint_base_unit, scale<7680, static_rational<-1> > > minim_base_unit;
} // namespace us
template<>
struct base_unit_info<us::minim_base_unit> {
static const char* name() { return("minim (U.S.)"); }
static const char* symbol() { return("minim"); }
};
} // namespace units
} // namespace boost
#endif // BOOST_UNITS_BASE_UNITS_US_MINIM_HPP_INCLUDED

View File

@@ -0,0 +1,39 @@
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
// Copyright (C) 2007-2008 Steven Watanabe
//
// 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_US_OUNCE_HPP_INCLUDED
#define BOOST_UNIT_SYSTEMS_US_OUNCE_HPP_INCLUDED
#include <boost/units/scaled_base_unit.hpp>
#include <boost/units/static_rational.hpp>
#include <boost/units/scale.hpp>
#include <boost/units/base_units/us/pound.hpp>
namespace boost {
namespace units {
namespace us {
typedef scaled_base_unit<pound_base_unit, scale<2, static_rational<-4> > > ounce_base_unit;
} // namespace us
template<>
struct base_unit_info<us::ounce_base_unit> {
static const char* name() { return("ounce"); }
static const char* symbol() { return("oz"); }
};
} // namespace units
} // namespace boost
#endif // BOOST_UNIT_SYSTEMS_US_OUNCE_HPP_INCLUDED

View File

@@ -0,0 +1,28 @@
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
// Copyright (C) 2007-2008 Steven Watanabe
//
// 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_BASE_UNITS_US_PINT_HPP_INCLUDED
#define BOOST_UNITS_BASE_UNITS_US_PINT_HPP_INCLUDED
#include <boost/units/config.hpp>
#include <boost/units/systems/si/volume.hpp>
#include <boost/units/conversion.hpp>
BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(us, pint, "pint (U.S.)", "pt", 0.4731765e-3, si::volume, -503);
#if BOOST_UNITS_HAS_BOOST_TYPEOF
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
BOOST_TYPEOF_REGISTER_TYPE(boost::units::us::pint_base_unit)
#endif
#endif // BOOST_UNITS_BASE_UNITS_US_PINT_HPP_INCLUDED

View File

@@ -0,0 +1,32 @@
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
// Copyright (C) 2007-2008 Steven Watanabe
//
// 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_US_POUND_HPP_INCLUDED
#define BOOST_UNIT_SYSTEMS_US_POUND_HPP_INCLUDED
#include <string>
#include <boost/units/config.hpp>
#include <boost/units/base_unit.hpp>
#include <boost/units/physical_dimensions/mass.hpp>
#include <boost/units/base_units/cgs/gram.hpp>
#include <boost/units/conversion.hpp>
BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(us, pound, "pound", "lb", 453.59237, cgs::gram_base_unit, -502); // exact conversion
#if BOOST_UNITS_HAS_BOOST_TYPEOF
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
BOOST_TYPEOF_REGISTER_TYPE(boost::units::us::pound_base_unit)
#endif
#endif // BOOST_UNIT_SYSTEMS_US_POUND_HPP_INCLUDED

View File

@@ -0,0 +1,32 @@
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2009 Matthias Christian Schabel
// Copyright (C) 2007-2009 Steven Watanabe
//
// 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_US_POUND_FORCE_HPP_INCLUDED
#define BOOST_UNIT_SYSTEMS_US_POUND_FORCE_HPP_INCLUDED
#include <string>
#include <boost/units/config.hpp>
#include <boost/units/base_unit.hpp>
//#include <boost/units/physical_dimensions/mass.hpp>
#include <boost/units/systems/si/force.hpp>
#include <boost/units/conversion.hpp>
BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(us, pound_force, "pound-force", "lbf", 4.4482216152605, si::force, -600); // exact conversion
#if BOOST_UNITS_HAS_BOOST_TYPEOF
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
BOOST_TYPEOF_REGISTER_TYPE(boost::units::us::pound_force_base_unit)
#endif
#endif // BOOST_UNIT_SYSTEMS_US_POUND_FORCE_HPP_INCLUDED

View File

@@ -0,0 +1,39 @@
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
// Copyright (C) 2007-2008 Steven Watanabe
//
// 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_BASE_UNITS_US_QUART_HPP_INCLUDED
#define BOOST_UNITS_BASE_UNITS_US_QUART_HPP_INCLUDED
#include <boost/units/scaled_base_unit.hpp>
#include <boost/units/static_rational.hpp>
#include <boost/units/scale.hpp>
#include <boost/units/base_units/us/pint.hpp>
namespace boost {
namespace units {
namespace us {
typedef scaled_base_unit<pint_base_unit, scale<2, static_rational<1> > > quart_base_unit;
} // namespace us
template<>
struct base_unit_info<us::quart_base_unit> {
static const char* name() { return("quart (U.S.)"); }
static const char* symbol() { return("qt"); }
};
} // namespace units
} // namespace boost
#endif // BOOST_UNITS_BASE_UNITS_US_QUART_HPP_INCLUDED

View File

@@ -0,0 +1,39 @@
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
// Copyright (C) 2007-2008 Steven Watanabe
//
// 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_BASE_UNITS_US_TABLESPOON_HPP_INCLUDED
#define BOOST_UNITS_BASE_UNITS_US_TABLESPOON_HPP_INCLUDED
#include <boost/units/scaled_base_unit.hpp>
#include <boost/units/static_rational.hpp>
#include <boost/units/scale.hpp>
#include <boost/units/base_units/us/pint.hpp>
namespace boost {
namespace units {
namespace us {
typedef scaled_base_unit<pint_base_unit, scale<2, static_rational<-5> > > tablespoon_base_unit;
} // namespace us
template<>
struct base_unit_info<us::tablespoon_base_unit> {
static const char* name() { return("tablespoon"); }
static const char* symbol() { return("tbsp"); }
};
} // namespace units
} // namespace boost
#endif // BOOST_UNITS_BASE_UNITS_US_TABLESPOON_HPP_INCLUDED

View File

@@ -0,0 +1,39 @@
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
// Copyright (C) 2007-2008 Steven Watanabe
//
// 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_BASE_UNITS_US_TEASPOON_HPP_INCLUDED
#define BOOST_UNITS_BASE_UNITS_US_TEASPOON_HPP_INCLUDED
#include <boost/units/scaled_base_unit.hpp>
#include <boost/units/static_rational.hpp>
#include <boost/units/scale.hpp>
#include <boost/units/base_units/us/pint.hpp>
namespace boost {
namespace units {
namespace us {
typedef scaled_base_unit<pint_base_unit, scale<96, static_rational<-1> > > teaspoon_base_unit;
} // namespace us
template<>
struct base_unit_info<us::teaspoon_base_unit> {
static const char* name() { return("teaspoon"); }
static const char* symbol() { return("tsp"); }
};
} // namespace units
} // namespace boost
#endif // BOOST_UNITS_BASE_UNITS_US_TEASPOON_HPP_INCLUDED

View File

@@ -0,0 +1,39 @@
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
// Copyright (C) 2007-2008 Steven Watanabe
//
// 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_BASE_UNITS_US_TON_HPP_INCLUDED
#define BOOST_UNIT_BASE_UNITS_US_TON_HPP_INCLUDED
#include <boost/units/scaled_base_unit.hpp>
#include <boost/units/static_rational.hpp>
#include <boost/units/scale.hpp>
#include <boost/units/base_units/us/pound.hpp>
namespace boost {
namespace units {
namespace us {
typedef scaled_base_unit<pound_base_unit, scale<2000, static_rational<1> > > ton_base_unit;
} // namespace us
template<>
struct base_unit_info<us::ton_base_unit> {
static const char* name() { return("short ton"); }
static const char* symbol() { return("t"); }
};
} // namespace units
} // namespace boost
#endif // BOOST_UNIT_BASE_UNITS_US_TON_HPP_INCLUDED

View File

@@ -0,0 +1,32 @@
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
// Copyright (C) 2007-2008 Steven Watanabe
//
// 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_SYSTEMS_US_YARD_BASE_UNIT_HPP
#define BOOST_UNITS_SYSTEMS_US_YARD_BASE_UNIT_HPP
#include <string>
#include <boost/units/config.hpp>
#include <boost/units/base_unit.hpp>
#include <boost/units/physical_dimensions/length.hpp>
#include <boost/units/base_units/si/meter.hpp>
#include <boost/units/conversion.hpp>
BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(us, yard, "yard", "yd", 0.9144, si::meter_base_unit, -501); // exact conversion
#if BOOST_UNITS_HAS_BOOST_TYPEOF
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
BOOST_TYPEOF_REGISTER_TYPE(boost::units::us::yard_base_unit)
#endif
#endif // BOOST_UNITS_SYSTEMS_US_YARD_BASE_UNIT_HPP