Home » U++ Library support » U++ Core » Add empty to STL_VECTOR_COMPATIBILITY
Add empty to STL_VECTOR_COMPATIBILITY [message #33240] |
Tue, 19 July 2011 16:24 |
cbpporter
Messages: 1401 Registered: September 2007
|
Ultimate Contributor |
|
|
I am having troubles using Vector as a base for priority_queue because it lack and empty method:
#define STL_VECTOR_COMPATIBILITY(C) \
typedef T value_type; \
typedef ConstIterator const_iterator; \
typedef const T& const_reference; \
typedef int size_type; \
typedef int difference_type; \
const_iterator begin() const { return Begin(); } \
const_iterator end() const { return End(); } \
void clear() { Clear(); } \
size_type size() { return GetCount(); } \
typedef Iterator iterator; \
typedef T& reference; \
iterator begin() { return Begin(); } \
iterator end() { return End(); } \
reference front() { return (*this)[0]; } \
const_reference front() const { return (*this)[0]; } \
reference back() { return Top(); } \
const_reference back() const { return Top(); } \
void push_back(const T& x) { Add(x); } \
void pop_back() { Drop(); } \
bool empty() const { return IsEmpty(); }
PS: Is there an U++ alternative to priority_queue that is at least as fast?
|
|
|
|
|
Goto Forum:
Current Time: Sun Apr 28 12:08:15 CEST 2024
Total time taken to generate the page: 0.04559 seconds
|