📄 sequence.qbk
字号:
[table Parameters [[Parameter] [Requirement] [Description]] [[`Seq`][A model of __forward_sequence__][Argument sequence]]][heading Expression Semantics] result_of::end<Seq>::type[*Return type]: A model of the same traversal concept as `Seq`.[*Semantics]: Returns the type of an iterator one past the end of `Seq`./sequence/intrinsic/end.hpp>[heading Example] typedef __vector__<int> vec; typedef __result_of_prior__<__result_of_end__<vec>::type>::type first; BOOST_MPL_ASSERT((__result_of_equal_to__<first, __result_of_begin__<vec>::type>))[endsect][section empty][heading Description]Returns the result type of __empty__.[heading Synopsis] template<typename Seq> struct empty { typedef __unspecified__ type; };[table Parameters [[Parameter] [Requirement] [Description]] [[`Seq`][A model of __forward_sequence__][Argument sequence]]][heading Expression Semantics] result_of::empty<Seq>::type[*Return type]: An __mpl_integral_constant__[*Semantics]: Returns `mpl::true_` if `Seq` has zero elements, `mpl::false_` otherwise./sequence/intrinsic/empty.hpp>[heading Example] typedef __vector__<> empty_vec; typedef __vector__<int,float,char> vec; BOOST_MPL_ASSERT((__result_of_empty__<empty_vec>)); BOOST_MPL_ASSERT_NOT((__result_of_empty__<vec>));[endsect][section front][heading Description]Returns the result type of __front__.[heading Synopsis] template<typename Seq> struct front { typedef __unspecified__ type; };[table Parameters [[Parameter] [Requirement] [Description]] [[`Seq`][A model of __forward_sequence__][Argument sequence]]][heading Expression Semantics] result_of::front<Seq>::type[*Return type]: Any type[*Semantics]: The type returned by dereferencing an iterator to the first element in `Seq`. Equivalent to `__result_of_deref__<__result_of_begin__<Seq>::type>::type`./sequence/intrinsic/front.hpp>[heading Example] typedef __vector__<int,char> vec; BOOST_MPL_ASSERT((boost::is_same<__result_of_front__<vec>::type, int&>));[endsect][section back][heading Description]Returns the result type of __back__.[heading Synopsis] template<typename Seq> struct back { typedef __unspecified__ type; };[table Parameters [[Parameter] [Requirement] [Description]] [[`Seq`][A model of __forward_sequence__][Argument sequence]]][heading Expression Semantics] result_of::back<Seq>::type[*Return type]: Any type[*Semantics]: The type returned by dereferencing an iterator to the last element in the sequence. Equivalent to `__result_of_deref__<__result_of_prior__<__result_of_end__<Seq>::type>::type>::type`./sequence/intrinsic/back.hpp>[heading Example] typedef __vector__<int,char> vec; BOOST_MPL_ASSERT((boost::is_same<__result_of_back__<vec>::type, char&>));[endsect][section size][heading Description]Returns the result type of __size__.[heading Synopsis] template<typename Seq> struct size { typedef __unspecified__ type; };[table Parameters [[Parameter] [Requirement] [Description]] [[`Seq`][A model of __forward_sequence__][Argument sequence]]][heading Expression Semantics] result_of::size<Seq>::type[*Return type]: An __mpl_integral_constant__.[*Semantics]: Returns the number of elements in `Seq`./sequence/intrinsic/size.hpp>[heading Example] typedef __vector__<int,float,char> vec; typedef __result_of_size__<vec>::type size_mpl_integral_constant; BOOST_MPL_ASSERT_RELATION(size_mpl_integral_constant::value, ==, 3);[endsect][section at][heading Description]Returns the result type of __at__[footnote __result_of_at__ reflects theactual return type of the function __at__. __sequence__(s) typically returnreferences to its elements via the __at__ function. If you want to getthe actual element type, use __result_of_value_at__].[heading Synopsis] template< typename Seq, typename N> struct at { typedef __unspecified__ type; };[table Parameters [[Parameter] [Requirement] [Description]] [[`Seq`][A model of __forward_sequence__][Argument sequence]] [[`N`][An __mpl_integral_constant__][Index of element]]][heading Expression Semantics] result_of::at<Seq, N>::type[*Return type]: Any type.[*Semantics]: Returns the result type of using __at__ to access the `N`th element of `Seq`./sequence/intrinsic/at.hpp>[heading Example] typedef __vector__<int,float,char> vec; BOOST_MPL_ASSERT((boost::is_same<__result_of_at__<vec, boost::mpl::int_<1> >::type, float&>));[endsect][section at_c][heading Description]Returns the result type of __at_c__[footnote __result_of_at_c__ reflectsthe actual return type of the function __at_c__. __sequence__(s) typicallyreturn references to its elements via the __at_c__ function. If you want toget the actual element type, use __result_of_value_at_c__].[heading Synopsis] template< typename Seq, int M> struct at_c { typedef __unspecified__ type; };[table Parameters [[Parameter] [Requirement] [Description]] [[`Seq`][A model of __forward_sequence__][Argument sequence]] [[`M`][Positive integer index][Index of element]]][heading Expression Semantics] result_of::at_c<Seq, M>::type[*Return type]: Any type[*Semantics]: Returns the result type of using __at_c__ to access the `M`th element of `Seq`./sequence/intrinsic/at.hpp>[heading Example] typedef __vector__<int,float,char> vec; BOOST_MPL_ASSERT((boost::is_same<__result_of_at_c__<vec, 1>::type, float&>));[endsect][section value_at][heading Description]Returns the actual type at a given index from the __sequence__.[heading Synopsis] template< typename Seq, typename N> struct value_at { typedef __unspecified__ type; };[table Parameters [[Parameter] [Requirement] [Description]] [[`Seq`][A model of __forward_sequence__][Argument sequence]] [[`N`][An __mpl_integral_constant__][Index of element]]][heading Expression Semantics] result_of::value_at<Seq, N>::type[*Return type]: Any type.[*Semantics]: Returns the actual type at the `N`th element of `Seq`./sequence/intrinsic/value_at.hpp>[heading Example] typedef __vector__<int,float,char> vec; BOOST_MPL_ASSERT((boost::is_same<__result_of_value_at__<vec, boost::mpl::int_<1> >::type, float>));[endsect][section value_at_c][heading Description]Returns the actual type at a given index from the __sequence__.[heading Synopsis] template< typename Seq, int M> struct value_at_c { typedef __unspecified__ type; };[table Parameters [[Parameter] [Requirement] [Description]] [[`Seq`][A model of __forward_sequence__][Argument sequence]] [[`M`][Positive integer index][Index of element]]][heading Expression Semantics] result_of::value_at_c<Seq, M>::type[*Return type]: Any type[*Semantics]: Returns the actual type at the `M`th element of `Seq`./sequence/intrinsic/value_at.hpp>[heading Example] typedef __vector__<int,float,char> vec; BOOST_MPL_ASSERT((boost::is_same<__result_of_value_at_c__<vec, 1>::type, float>));[endsect][section has_key][heading Description]Returns the result type of __has_key__.[heading Synopsis] template< typename Seq, typename Key> struct has_key { typedef __unspecified__ type; };[table Parameters [[Parameter] [Requirement] [Description]] [[`Seq`][A model of __forward_sequence__][Argument sequence]] [[`Key`][Any type][Key type]]][heading Expression Semantics] result_of::has_key<Seq, Key>::type[*Return type]: An __mpl_integral_constant__.[*Semantics]: Returns `mpl::true_` if `Seq` contains an element with key type `Key`, returns `mpl::false_` otherwise./sequence/intrinsic/has_key.hpp>[heading Example] typedef __map__<__pair__<int, char>, __pair__<char, char>, __pair__<double, char> > mymap; BOOST_MPL_ASSERT((__result_of_has_key__<mymap, int>)); BOOST_MPL_ASSERT_NOT((__result_of_has_key__<mymap, void*>));[endsect][section at_key][heading Description]Returns the result type of __at_key__[footnote __result_of_at_key__reflects the actual return type of the function __at_key__. __sequence__stypically return references to its elements via the __at_key__ function. Ifyou want to get the actual element type, use __result_of_value_at_key__].[heading Synopsis] template< typename Seq, typename Key> struct at_key { typedef __unspecified__ type; };[table Parameters [[Parameter] [Requirement] [Description]] [[`Seq`][A model of __forward_sequence__][Argument sequence]] [[`Key`][Any type][Key type]]][heading Expression Semantics] result_of::at_key<Seq, Key>::type[*Return type]: Any type.[*Semantics]: Returns the result of using __at_key__ to access the element with key type `Key` in `Seq`./sequence/intrinsic/at_key.hpp>[heading Example] typedef __map__<__pair__<int, char>, __pair__<char, char>, __pair__<double, char> > mymap; BOOST_MPL_ASSERT((boost::is_same<__result_of_at_key__<mymap, int>::type, char&>));[endsect][section value_at_key][heading Description]Returns the actual element type associated with a Key from the __sequence__.[heading Synopsis] template< typename Seq, typename Key> struct value_at_key { typedef __unspecified__ type; };[table Parameters [[Parameter] [Requirement] [Description]] [[`Seq`][A model of __forward_sequence__][Argument sequence]] [[`Key`][Any type][Key type]]][heading Expression Semantics] result_of::value_at_key<Seq, Key>::type[*Return type]: Any type.[*Semantics]: Returns the actual element type associated with key type`Key` in `Seq`./sequence/intrinsic/value_at_key.hpp>[heading Example] typedef __map__<__pair__<int, char>, __pair__<char, char>, __pair__<double, char> > mymap; BOOST_MPL_ASSERT((boost::is_same<__result_of_at_key__<mymap, int>::type, char>));[endsect][section swap][heading Description]Returns the return type of swap.[heading Synopsis] template<typename Seq1, typename Seq2> struct swap { typedef void type; };[table Parameters [[Parameters] [Requirement] [Description]] [[`Seq1`, `Seq2`][Models of __forward_sequence__][The sequences being swapped]]][heading Expression Semantics] result_of::swap<Seq1, Seq2>::type[*Return type]: `void`.[*Semantics]: Always returns `void`./sequence/intrinsic/swap.hpp>[endsect][endsect][endsect][section Operator]These operators, like the __algorithms__, work generically on all Fusionsequences. All conforming Fusion sequences automatically get theseoperators for free.[section I/O]The I/O operators: `<<` and `>>` work generically on all Fusion sequences.The global `operator<<` has been overloaded for generic output streams such
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -