mirror of
https://github.com/ETLCPP/etl.git
synced 2026-11-09 14:49:53 +08:00
Add container_type type definition to etl::queue to better match std::queue (#378)
* Add container_type type definition to better match std::queue * Add container_type typedef to priority_queue and stack classes to maximize compatibility with the std library
This commit is contained in:
parent
f131356dc2
commit
9c2b5c3d75
@ -418,6 +418,7 @@ namespace etl
|
||||
public:
|
||||
|
||||
typedef typename TContainer::size_type size_type;
|
||||
typedef TContainer container_type;
|
||||
|
||||
static ETL_CONSTANT size_type MAX_SIZE = size_type(SIZE);
|
||||
|
||||
|
||||
@ -584,7 +584,8 @@ namespace etl
|
||||
|
||||
public:
|
||||
|
||||
typedef typename base_t::size_type size_type;
|
||||
typedef typename base_t::size_type size_type;
|
||||
typedef typename etl::aligned_storage<sizeof(T), etl::alignment_of<T>::value>::type container_type;
|
||||
|
||||
ETL_STATIC_ASSERT((SIZE <= etl::integral_limits<size_type>::max), "Size too large for memory model");
|
||||
|
||||
@ -657,7 +658,7 @@ namespace etl
|
||||
private:
|
||||
|
||||
/// The uninitialised buffer of T used in the queue.
|
||||
typename etl::aligned_storage<sizeof(T), etl::alignment_of<T>::value>::type buffer[SIZE];
|
||||
container_type buffer[SIZE];
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -528,6 +528,7 @@ namespace etl
|
||||
class stack : public etl::istack<T>
|
||||
{
|
||||
public:
|
||||
typedef typename etl::aligned_storage<sizeof(T), etl::alignment_of<T>::value>::type container_type;
|
||||
|
||||
static ETL_CONSTANT size_t MAX_SIZE = SIZE;
|
||||
|
||||
@ -598,7 +599,7 @@ namespace etl
|
||||
private:
|
||||
|
||||
/// The unintitialised buffer of T used in the stack.
|
||||
typename etl::aligned_storage<sizeof(T), etl::alignment_of<T>::value>::type buffer[SIZE];
|
||||
container_type buffer[SIZE];
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user