C++ åèæå
- C++11
- C++14
- C++17
- C++20
- C++ ç¼è¯å¨æ¯ææ åµè¡¨
- ç¬ç«ä¸å®¿ä¸»å®ç°
- C++ è¯è¨
- C++ å ³é®è¯
- é¢å¤çå¨
- C++ æ ååºå¤´æä»¶
- å ·åè¦æ±
- åè½ç¹æ§æµè¯ (C++20)
- å·¥å ·åº
- ç±»åæ¯æï¼åºæ¬ç±»åãRTTIãç±»åç¹æ§ï¼
- æ¦å¿µåº (C++20)
- é误å¤ç
- 卿å å管ç
- æ¥æåæ¶é´å·¥å ·
- å符串åº
- 容å¨åº
- std::array
- std::vector
- std::map
- std::unordered_map
- std::priority_queue
- std::span
- std::forward_list
- std::forward_list<T,Allocator>::forward_list
- std::forward_list<T,Allocator>::~forward_list
- std::forward_list<T,Allocator>::operator=
- std::forward_list<T,Allocator>::unique
- std::forward_list<T,Allocator>::reverse
- std::forward_list<T,Allocator>::sort
- std::forward_list çæ¨å¯¼æå¼
- std::forward_list<T,Allocator>::merge
- std::forward_list<T,Allocator>::splice_after
- std::forward_list<T,Allocator>::remove, remove_if
- operator==,!=,<,<=,>,>=,<=>(std::forward_list)
- std::swap(std::forward_list)
- std::erase, std::erase_if (std::forward_list)
- std::forward_list<T,Allocator>::swap
- std::forward_list<T,Allocator>::erase_after
- std::forward_list<T,Allocator>::push_front
- std::forward_list<T,Allocator>::emplace_front
- std::forward_list<T,Allocator>::pop_front
- std::forward_list<T,Allocator>::resize
- std::forward_list<T,Allocator>::empty
- std::forward_list<T,Allocator>::max_size
- std::forward_list<T,Allocator>::clear
- std::forward_list<T,Allocator>::insert_after
- std::forward_list<T,Allocator>::emplace_after
- std::forward_list<T,Allocator>::begin, std::forward_list<T,Allocator>::cbegin
- std::forward_list<T,Allocator>::end, std::forward_list<T,Allocator>::cend
- std::forward_list<T,Allocator>::assign
- std::forward_list<T,Allocator>::get_allocator
- std::forward_list<T,Allocator>::front
- std::forward_list<T,Allocator>::before_begin, cbefore_begin
- std::deque
- std::list
- std::set
- std::multiset
- std::multimap
- std::unordered_set
- std::unordered_multiset
- std::unordered_multimap
- std::stack
- std::queue
- std::vector<bool>
- ç»ç¹ææ (C++17)
- 注é
- è¿ä»£å¨åº
- èå´åº (C++20)
- ç®æ³åº
- æ°å¼åº
- è¾å ¥/è¾åºåº
- æä»¶ç³»ç»åº
- æ¬å°ååº
- æ£å表达å¼åº
- ååæä½åº
- çº¿ç¨æ¯æåº
- å®éªæ§ C++ ç¹æ§
- æç¨çèµæº
- ç´¢å¼
- std 符å·ç´¢å¼
- åç¨æ¯æ (C++20)
- C++ å ³é®è¯
ä½ç½®ï¼é¦é¡µ > C++ åèæå >容å¨åº > std::forward_list
std::forward_list
| å®ä¹äºå¤´æä»¶ <forward_list>
|
||
| template< Â Â class T, |
(1) | (C++11 èµ·) |
| namespace pmr { Â Â template <class T> |
(2) | (C++17 èµ·) |
std::forward_list æ¯æ¯æä»å®¹å¨ä¸çä»»ä½ä½ç½®å¿«éæå
¥åç§»é¤å
ç´ ç容å¨ã䏿¯æå¿«ééæºè®¿é®ãå®å®ç°ä¸ºåé¾è¡¨ï¼ä¸å®è´¨ä¸ä¸å
¶å¨ C ä¸å®ç°ç¸æ¯æ ä»»ä½å¼éãä¸ std::list ç¸æ¯ï¼æ¤å®¹å¨å¨ä¸éè¦ååè¿ä»£æ¶æä¾æ´ææå°å©ç¨ç©ºé´çåå¨ã
å¨é¾è¡¨å æè·¨æ°ä¸ªé¾è¡¨æ·»å ãç§»é¤åç§»å¨å ç´ ï¼ä¸ä¼éæ³åå½åæä»£é¾è¡¨ä¸å ¶ä»å ç´ çè¿ä»£å¨ãç¶èï¼å¨ä»é¾è¡¨ç§»é¤å ç´ ï¼éè¿ erase_after ï¼æ¶ï¼æä»£å¯¹åºå ç´ çè¿ä»£å¨æå¼ç¨ä¼è¢«éæ³åã
std::forward_list æ»¡è¶³å®¹å¨ (Container) ï¼é¤äº operator== çå¤æåº¦å§ç»ä¸ºçº¿æ§å size 彿°ï¼ãå
·åé
å¨å®¹å¨ (AllocatorAwareContainer) ååºåå®¹å¨ (SequenceContainer) çè¦æ±ã
模æ¿å½¢å
| T | - | å
ç´ çç±»åã
| ||||
| Allocator | - | ç¨äºè·å/éæ¾å ååæé /ææå åä¸å ç´ çåé å¨ãç±»åå¿ é¡»æ»¡è¶³åé å¨ (Allocator) çè¦æ±ãè¥ Allocator::value_type ä¸ T ä¸ååè¡ä¸ºæªå®ä¹ã |
æåç±»å
| Â | |
| æåç±»å | å®ä¹ |
value_type
|
T |
allocator_type
|
Allocator |
size_type
|
æ ç¬¦å·æ´æ°ç±»åï¼éå¸¸æ¯ std::size_t ï¼ |
difference_type
|
æç¬¦å·æ´æ°ç±»åï¼éå¸¸æ¯ std::ptrdiff_t ï¼ |
reference
|
value_type& |
const_reference
|
const value_type& |
pointer
|
std::allocator_traits<Allocator>::pointer |
const_pointer
|
std::allocator_traits<Allocator>::const_pointer |
iterator
|
éçååè¿ä»£å¨ (LegacyForwardIterator) |
const_iterator
|
常ååè¿ä»£å¨ |
æå彿°
æé forward_list (å ¬å¼æå彿°) | |
ææ forward_list (å ¬å¼æå彿°) | |
| èµå¼ç»å®¹å¨ (å ¬å¼æå彿°) | |
| å°å¼èµç»å®¹å¨ (å ¬å¼æå彿°) | |
| è¿åç¸å
³çåé
å¨ (å ¬å¼æå彿°) | |
å ç´ è®¿é® | |
| 访é®ç¬¬ä¸ä¸ªå
ç´ (å ¬å¼æå彿°) | |
è¿ä»£å¨ | |
| è¿åæå第ä¸ä¸ªå
ç´ ä¹åè¿ä»£å¨ (å ¬å¼æå彿°) | |
| è¿åæå容å¨ç¬¬ä¸ä¸ªå
ç´ çè¿ä»£å¨ (å ¬å¼æå彿°) | |
| è¿åæå容å¨å°¾ç«¯çè¿ä»£å¨ (å ¬å¼æå彿°) | |
容é | |
| æ£æ¥å®¹å¨æ¯å¦ä¸ºç©º (å ¬å¼æå彿°) | |
| è¿åå¯å®¹çº³çæå¤§å
ç´ æ° (å ¬å¼æå彿°) | |
ä¿®æ¹å¨ | |
| æ¸
é¤å
容 (å ¬å¼æå彿°) | |
| å¨æä¸ªå
ç´ åæå
¥æ°å
ç´ (å ¬å¼æå彿°) | |
| å¨å
ç´ åå使é å
ç´ (å ¬å¼æå彿°) | |
| æ¦é¤å
ç´ åçå
ç´ (å ¬å¼æå彿°) | |
| æå
¥å
ç´ å°å®¹å¨èµ·å§ (å ¬å¼æå彿°) | |
| å¨å®¹å¨å¤´é¨å°±å°æé å
ç´ (å ¬å¼æå彿°) | |
| ç§»é¤é¦å
ç´ (å ¬å¼æå彿°) | |
| æ¹å容å¨ä¸å¯åå¨å
ç´ çä¸ªæ° (å ¬å¼æå彿°) | |
| 交æ¢å
容 (å ¬å¼æå彿°) | |
æä½ | |
| åå¹¶äºä¸ªå·²æåºå表 (å ¬å¼æå彿°) | |
ä»å¦ä¸ forward_list ç§»å¨å
ç´ (å ¬å¼æå彿°) | |
| ç§»é¤æ»¡è¶³ç¹å®æ åçå
ç´ (å ¬å¼æå彿°) | |
| å°è¯¥é¾è¡¨çææå
ç´ ç顺åºå转 (å ¬å¼æå彿°) | |
| å é¤è¿ç»çéå¤å
ç´ (å ¬å¼æå彿°) | |
| 对å
ç´ è¿è¡æåº (å ¬å¼æå彿°) | |
éæå彿°
| (C++20 ä¸ç§»é¤)(C++20 ä¸ç§»é¤)(C++20 ä¸ç§»é¤)(C++20 ä¸ç§»é¤)(C++20 ä¸ç§»é¤)(C++20) |
æç
§åå
¸é¡ºåºæ¯è¾ forward_list ä¸çå¼ (彿°æ¨¡æ¿) |
| (C++11) |
ç¹å std::swap ç®æ³ (彿°æ¨¡æ¿) |
| æ¦é¤æææ»¡è¶³ç¹å®å¤å«æ åçå
ç´ (彿°æ¨¡æ¿) |