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

The MPL Reference Manual: pop_front

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 / Sequences / Intrinsic Metafunctions / pop_front

pop_front

Synopsis

template<
      typename Sequence
    >
struct pop_front
{
    typedef unspecified type;
};

Description

pop_front выполняет удаление в начале последовательности с гарантированной O(1) сложностью.

Parameters

Parameter Requirement Description
Следствие Фронт экстенсивная последовательность Последовательность для удаления первого элемента.

Expression semantics

Для любого Front Extensible Sequence s:

typedef pop_front<s>::type r;
Return type:Front Extensible Sequence.
Precondition:empty<s>::value == false.
Semantics:Equivalent to erase<s,begin<s>::type>::type;.
Postcondition:size<r>::value == size<s>::value - 1.

Complexity

Амортированное постоянное время.

Example

typedef vector<long>::type types1;
typedef vector<int,long>::type types2;
typedef vector<char,int,long>::type types3;
typedef pop_front<types1>::type result1;
typedef pop_front<types2>::type result2;
typedef pop_front<types3>::type result3;
BOOST_MPL_ASSERT_RELATION( size<result1>::value, ==, 0 );
BOOST_MPL_ASSERT_RELATION( size<result2>::value, ==, 1 );
BOOST_MPL_ASSERT_RELATION( size<result3>::value, ==, 2 );
BOOST_MPL_ASSERT(( is_same< front<result2>::type, long > ));
BOOST_MPL_ASSERT(( is_same< front<result3>::type, int > ));

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




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



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


реклама


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

Время компиляции файла: 2024-08-30 11:47:00
2025-05-19 22:54:38/0.0085391998291016/1