// 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_DETAIL_DIMENSIONLESS_UNIT_HPP #define BOOST_UNITS_DETAIL_DIMENSIONLESS_UNIT_HPP #include #include namespace boost { namespace units { template struct heterogeneous_system; template struct homogeneous_system; template struct heterogeneous_system_impl; namespace detail { template struct void_if_dimensionless { typedef int type; }; template struct void_if_dimensionless > { typedef void type; }; template<> struct void_if_dimensionless< boost::units::heterogeneous_system< boost::units::heterogeneous_system_impl< boost::units::dimensionless_type, boost::units::dimensionless_type, boost::units::dimensionless_type > > > { typedef void type; }; template struct void_if_heterogeneous { typedef void type; }; template struct void_if_heterogeneous::type> { typedef int type; }; template struct is_dimensionless_system : mpl::false_ {}; template struct is_dimensionless_system::type> : mpl::true_ {}; #define BOOST_UNITS_DIMENSIONLESS_UNIT(T)\ boost::units::unit<\ boost::units::dimensionless_type,\ T,\ typename ::boost::units::detail::void_if_dimensionless::type\ > #define BOOST_UNITS_HETEROGENEOUS_DIMENSIONLESS_UNIT(T)\ boost::units::unit<\ boost::units::dimensionless_type,\ T,\ typename ::boost::units::detail::void_if_heterogeneous::type\ > } } } #endif