Карта сайта Kansoftware
НОВОСТИУСЛУГИРЕШЕНИЯКОНТАКТЫ
Разработка программного обеспечения

The MPL Reference Manual: or_

Boost , ,

Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

Front Page / Metafunctions / Logical Operations / or_

or_

Synopsis

template<
      typename F1
    , typename F2
    ...
    , typename Fn = unspecified
    >
struct or_
{
    typedef unspecified type;
};

Description

Возвращает результат короткого замыканиялогический или(| |, основываясь на своих аргументах.

Parameters

Parameter Requirement Description
F1,F2, ...Фн нулевойМетафункция Аргументы операции.

Expression semantics

Для произвольного нулевогоМетафункцияsf1,f2, ...fn:

typedef or_<f1,f2,...,fn>::type r;
Return type:Integral Constant.
Semantics:r is true_ if either of f1::type::value, f2::type::value,... fn::type::value expressions evaluates to true, and false_ otherwise; guarantees left-to-right evaluation; the operands subsequent to the first fi metafunction that evaluates to true are not evaluated.
typedef or_<f1,f2,...,fn> r;
Return type:

Integral Constant.

Semantics:

Equivalent to

struct r : or_<f1,f2,...,fn>::type {};

Example

struct unknown;
BOOST_MPL_ASSERT(( or_< true_,true_ > ));
BOOST_MPL_ASSERT(( or_< false_,true_ > ));
BOOST_MPL_ASSERT(( or_< true_,false_ > ));
BOOST_MPL_ASSERT_NOT(( or_< false_,false_ > ));
BOOST_MPL_ASSERT(( or_< true_,unknown > )); // OK
BOOST_MPL_ASSERT(( or_< true_,unknown,unknown > )); // OK too

Статья The MPL Reference Manual: or_ раздела может быть полезна для разработчиков на c++ и boost.




Материалы статей собраны из открытых источников, владелец сайта не претендует на авторство. Там где авторство установить не удалось, материал подаётся без имени автора. В случае если Вы считаете, что Ваши права нарушены, пожалуйста, свяжитесь с владельцем сайта.



:: Главная :: ::


реклама


©KANSoftWare (разработка программного обеспечения, создание программ, создание интерактивных сайтов), 2007
Top.Mail.Ru

Время компиляции файла: 2024-08-30 11:47:00
2025-05-20 13:44:59/0.0033190250396729/0