⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test_unit.cpp

📁 Boost provides free peer-reviewed portable C++ source libraries. We emphasize libraries that work
💻 CPP
字号:
// 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) 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)/** \file    \brief test_units_1.cpp\detailedTest unit class.Output:@verbatim@endverbatim**/#include "test_header.hpp"#include <boost/units/pow.hpp>namespace bu = boost::units;int test_main(int,char *[]){    const bu::dimensionless D;        const bu::length        L;    const bu::mass          M;    const bu::time          T;        BOOST_CHECK(+L == L);    BOOST_CHECK(-L == L);    BOOST_CHECK(L+L == L);    BOOST_CHECK(L-L == L);    BOOST_CHECK(+M == M);    BOOST_CHECK(-M == M);    BOOST_CHECK(M+M == M);    BOOST_CHECK(M-M == M);        const bu::area          A;    const bu::energy        E;    const bu::velocity      V;        BOOST_CHECK(L*L == A);    BOOST_CHECK(A == L*L);        BOOST_CHECK(L/L == D);    BOOST_CHECK(D == L/L);        BOOST_CHECK(L/T == V);    BOOST_CHECK(V == L/T);        BOOST_CHECK(M*L*L/T/T == E);    BOOST_CHECK(M*(L/T)*(L/T) == E);    BOOST_CHECK(M*bu::pow<2>(L/T) == E);    BOOST_CHECK(bu::root<2>(E/M) == V);        return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -