a deque extension implementing python's list-like interfaces.
More...
#include <proton/deque.hpp>
Inherits std::deque< T >.
List of all members.
Public Member Functions |
template<typename... argT> |
| deque_ (argT &&...a) |
| forwarding ctor.
|
| deque_ (std::initializer_list< T > a) |
| initializer_list forwarding ctor.
|
| deque_ (const deque_ &x) |
| copy ctor.
|
| deque_ (deque_ &&x) noexcept |
| move ctor.
|
deque_ & | operator= (const deque_ &x) |
| assign.
|
| operator baseT & () |
| cast to std::deque<>&.
|
T & | operator[] (offset_t i) |
| [i] in python
|
const T & | operator[] (offset_t i) const |
| [i] in python
|
deque_ | operator() (offset_t i) const |
| slice of [i:]
|
deque_ | operator() (offset_t i, offset_t j) const |
| slice of [i:j]
|
deque_ | operator() (offset_t i, offset_t j, size_t k) const |
| slice of [i:j:k]
|
void | append (const T &x) |
| append an item at the end.
|
size_t | count (const T &x) const |
| total number of occurences of x.
|
void | del (offset_t i) |
| delete the i-th item
|
void | del (offset_t i, offset_t j) |
| delete from i-th to the j-th items
|
void | del_to_end (offset_t i) |
| delete from i-th item to the end
|
template<typename seqT > |
void | extend (const seqT &x) |
| append items from a sequence.
|
offset_t | index (const T &val) const |
| index of the first occurence of a value.
|
void | insert (offset_t i, const T &val) |
| insert value at offset i.
|
T | pop (offset_t i=-1) |
| pop an item from the sequence.
|
void | remove (const T &val) |
| remove the first occurence of a value.
|
void | reverse () |
| reverses the items in place.
|
void | sort () |
| sort the items in place.
|
template<class cmpT > |
void | sort (cmpT cmp) |
| sort the items in place using a customized cmp.
|
Additional Inherited Members |
T | elements |
| STL member.
|
Detailed Description
template<typename T, typename A = smart_allocator<T>>
class proton::deque_< T, A >
a deque extension implementing python's list-like interfaces.
- Examples:
- deque.cpp, and string.cpp.
Definition at line 186 of file deque.hpp.
Member Function Documentation
template<typename T, typename A = smart_allocator<T>>
index of the first occurence of a value.
- Parameters:
-
- Exceptions:
-
std::invalid_argument | if there is no such a value. |
Definition at line 412 of file deque.hpp.
template<typename T, typename A = smart_allocator<T>>
insert value at offset i.
- Parameters:
-
i | the offset, like python, -1 means the last position. |
val | the value. |
- Exceptions:
-
Definition at line 426 of file deque.hpp.
template<typename T, typename A = smart_allocator<T>>
pop an item from the sequence.
- Parameters:
-
i | the index of the itme, default is -1, the last item. |
- Returns:
- the value at offset i.
- Exceptions:
-
Definition at line 443 of file deque.hpp.
template<typename T, typename A = smart_allocator<T>>
remove the first occurence of a value.
- Parameters:
-
- Exceptions:
-
std::invalid_argument | if there is no such a value. |
Definition at line 455 of file deque.hpp.
The documentation for this class was generated from the following file:
- D:/projects/gcc/libproton/include/proton/deque.hpp