dimensionless_unit.hpp
来自「Boost provides free peer-reviewed portab」· HPP 代码 · 共 86 行
HPP
86 行
// 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 <boost/utility/enable_if.hpp>#include <boost/mpl/bool.hpp>#include <boost/units/units_fwd.hpp>namespace boost {namespace units {template<class T>struct heterogeneous_system;template<class T>struct homogeneous_system;template<class T1, class T2, class Scale>struct heterogeneous_system_impl;namespace detail {template<class T>struct is_dimensionless_system : boost::mpl::false_ {};template<class T>struct is_dimensionless_system<boost::units::homogeneous_system<T> > : boost::mpl::true_ {};template<>struct is_dimensionless_system< boost::units::heterogeneous_system< boost::units::heterogeneous_system_impl< boost::units::dimensionless_type, boost::units::dimensionless_type, boost::units::dimensionless_type > >> : boost::mpl::true_ {};#ifdef BOOST_MSVC#define BOOST_UNITS_DIMENSIONLESS_UNIT(T)\ boost::units::unit<\ typename boost::enable_if<boost::units::detail::is_dimensionless_system<T>, boost::units::dimensionless_type>::type,\ T\ >#define BOOST_UNITS_HETEROGENEOUS_DIMENSIONLESS_UNIT(T)\ boost::units::unit<\ typename boost::disable_if<boost::units::detail::is_dimensionless_system<T>, boost::units::dimensionless_type>::type,\ T\ >#else#define BOOST_UNITS_DIMENSIONLESS_UNIT(T)\ boost::units::unit<\ boost::units::dimensionless_type,\ T,\ typename boost::enable_if<boost::units::detail::is_dimensionless_system<T> >::type\ >#define BOOST_UNITS_HETEROGENEOUS_DIMENSIONLESS_UNIT(T)\ boost::units::unit<\ boost::units::dimensionless_type,\ T,\ typename boost::disable_if<boost::units::detail::is_dimensionless_system<T> >::type\ >#endif}}}#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?