|
Boost-Commit : |
From: steven_at_[hidden]
Date: 2008-05-15 22:58:34
Author: steven_watanabe
Date: 2008-05-15 22:58:34 EDT (Thu, 15 May 2008)
New Revision: 45415
URL: http://svn.boost.org/trac/boost/changeset/45415
Log:
Document power/root_typeof_helper
Text files modified:
sandbox/units/boost/units/operators.hpp | 34 +++++++++++++++++++++++++++++++++-
sandbox/units/boost/units/pow.hpp | 2 +-
2 files changed, 34 insertions(+), 2 deletions(-)
Modified: sandbox/units/boost/units/operators.hpp
==============================================================================
--- sandbox/units/boost/units/operators.hpp (original)
+++ sandbox/units/boost/units/operators.hpp 2008-05-15 22:58:34 EDT (Thu, 15 May 2008)
@@ -21,7 +21,7 @@
///
/// \detailed
/// These operators declare the compile-time operators needed to support dimensional
-/// analysis algebra. Specializations must be defined for all desired operand types.
+/// analysis algebra. They require the use of Boost.Typeof.
/// Typeof helper classes define result type for heterogeneous operators on value types.
/// These must be defined through specialization for powers and roots.
@@ -118,6 +118,38 @@
template<typename X,typename Y> struct power_typeof_helper;
template<typename X,typename Y> struct root_typeof_helper;
+#ifdef BOOST_UNITS_DOXYGEN
+
+/// A helper for computing the result of
+/// raising a runtime object to a compile time
+/// known exponent. This template is intended to
+/// be specialized. All specializations must
+/// conform to the interface shown here.
+template<typename BaseType, typename Exponent>
+struct power_typeof_helper
+{
+ /// specifies the result type
+ typedef detail::unspecified type;
+ /// Carries out the runtime calculation.
+ static type value(const BaseType& base);
+};
+
+/// A helper for computing taking a root
+/// of a runtime object using a compile time
+/// known index. This template is intended to
+/// be specialized. All specializations must
+/// conform to the interface shown here.
+template<typename Radicand, typename Index>
+struct root_typeof_helper
+{
+ /// specifies the result type
+ typedef detail::unspecified type;
+ /// Carries out the runtime calculation.
+ static type value(const BaseType& base);
+};
+
+#endif
+
} // namespace units
} // namespace boost
Modified: sandbox/units/boost/units/pow.hpp
==============================================================================
--- sandbox/units/boost/units/pow.hpp (original)
+++ sandbox/units/boost/units/pow.hpp 2008-05-15 22:58:34 EDT (Thu, 15 May 2008)
@@ -18,7 +18,7 @@
#include <boost/units/detail/static_rational_power.hpp>
/// \file
-/// \brief Raise values to exponents known as compile-time
+/// \brief Raise values to exponents known at compile-time
namespace boost {
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