名前空間
変種
操作

std::forward_list::splice_after

提供: cppreference.com

 
 
 
std::forward_list
メンバ関数
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
forward_list::forward_list
forward_list::~forward_list
forward_list::operator=
forward_list::assign
forward_list::get_allocator
要素アクセスの循環参照を解除するために使用されている
Original:
Element access
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
forward_list::front
イテレータ
Original:
Iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
forward_list::before_begin
forward_list::cbefore_begin
forward_list::begin
forward_list::cbegin
forward_list::end
forward_list::cend
容量
Original:
Capacity
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
forward_list::empty
forward_list::max_size
修飾子
Original:
Modifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
forward_list::clear
forward_list::insert_after
forward_list::emplace_after
forward_list::erase_after
forward_list::push_front
forward_list::emplace_front
forward_list::pop_front
forward_list::resize
forward_list::swap
操作
Original:
Operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
forward_list::merge
forward_list::splice_after
forward_list::remove
forward_list::remove_if
forward_list::reverse
forward_list::unique
forward_list::sort
 
void splice_after(const_iterator pos, forward_list& other);
(1) (C + + 11以来)
void splice_after(const_iterator pos, forward_list&& other);
(1) (C + + 11以来)
void splice_after(const_iterator pos, forward_list& other, const_iterator it);
(2) (C + + 11以来)
void splice_after(const_iterator pos, forward_list&& other, const_iterator it);
(2) (C + + 11以来)
void splice_after(const_iterator pos, forward_list& other,
                  const_iterator first, const_iterator last);
(3) (C + + 11以来)
void splice_after(const_iterator pos, forward_list&& other,
                  const_iterator first, const_iterator last);
(3) (C + + 11以来)
forward_listから*thisに要素を移動.
Original:
Moves elements from another forward_list to *this.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
何も要素はコピーされません。 pos*thisで有効なイテレータであるかbefore_begin()イテレータです。 get_allocator() != other.get_allocator()場合の動作は未定義です。無効になるんイテレータや参照は、移動した要素へのイテレータは今ではない*thisに、otherに参照していない.
Original:
No elements are copied. pos is a valid iterator in *this or is the before_begin() iterator. The behavior is undefined if get_allocator() != other.get_allocator(). No iterators or references become invalidated, the iterators to moved elements now refer into *this, not into other.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
1)
other*thisからすべての要素を移動します。要素はposが指す要素の後に挿入されます。コンテナotherは術後空になります。 this == &other場合の動作は未定義です
Original:
Moves all elements from other into *this. The elements are inserted after the element pointed to by pos. The container other becomes empty after the operation. The behavior is undefined if this == &other
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
要素はitからother*thisによって指さ移動します。要素がposによって指さ後に要素が挿入され.
Original:
Moves the element pointed to by it from other into *this. The element is inserted after the element pointed to by pos.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
3)
(first, last)otherから*thisに範囲内の要素を移動します。要素はposが指す要素の後に挿入されます。要素が指摘ツーfirstが移動されていませんで。 posが範囲(first,last)でイテレータの場合の動作は未定義です.
Original:
Moves the elements in the range (first, last) from other into *this. The elements are inserted after the element pointed to by pos. The element pointed-to by first is not moved. The behavior is undefined if pos is an iterator in the range (first,last).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

目次

[編集] パラメータ

pos -
要素は後にコンテンツが挿入されます
Original:
element after which the content will be inserted
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
other -
からコンテンツを移動するための別のコンテナ
Original:
another container to move the content from
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
it -
otherから*thisに移動する要素
Original:
the element to move from other to *this
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
first, last -
otherから*thisに移動する要素の範囲
Original:
the range of elements to move from other to *this
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 値を返します

(なし)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 複雑

1)
otherの大きさに比例
Original:
Linear in the size of other
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
定数
Original:
Constant
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
3)
std::distance(first, last)のリニア
Original:
Linear in std::distance(first, last)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集]

splice_afterの第三の形式()内の開区間の意味(最初、最後)を示しています:l1の最初の要素は移動されません.
Original:
Demonstrates the meaning of open interval (first, last) in the third form of splice_after(): the first element of l1 is not moved.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

#include <iostream>
#include <forward_list>
int main()
{
    std::forward_list<int> l1 = {1,2,3,4,5};
    std::forward_list<int> l2 = {10,11,12};
 
    l2.splice_after(l2.cbegin(), l1, l1.cbegin(), l1.cend());
    // not equivalent to l2.splice_after(l2.cbegin(), l1);
 
    for(int n : l1)
        std::cout << n << ' ';
    std::cout << '\n';
 
    for(int n : l2)
        std::cout << n << ' ';
    std::cout << '\n';
}

Output:

1
10 2 3 4 5 11 12

[編集] も参照してください

2ソートされたリストをマージします
Original:
merges two sorted lists
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
特定の条件を満たす要素を削除します
Original:
removes elements satisfying specific criteria
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]