Home » Developing U++ » U++ Developers corner » Initialization for Buffer<T>
Re: Initialization for Buffer<T> [message #45221 is a reply to message #45217] |
Fri, 09 October 2015 17:34 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
Actually, it is guaranteed.
typedef T *Iterator
Iterator type. Iterator is guaranteed to be of T* type.
operator T*()
Returns non-constant pointer to elements.
operator const T*() const
Returns constant pointer to elements.
I agree that more clearly worded guarantee should be given here (this is sort of implicit). Updating docs now...
Buffer indeed is replacement of situation
byte *buffer = new byte[N];
...
delete[] buffer;
but adding GetCount() would mean it is less efficient that this raw code. In the situation when you need GetCount, overhead of Vector is so small that you should perhaps use it instead (it only stores 'alloc' in addition to 'count').
[Updated on: Fri, 09 October 2015 17:38] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Tue May 07 07:33:10 CEST 2024
Total time taken to generate the page: 0.02751 seconds
|