Блог пользователя Tensor

Автор Tensor, 12 лет назад, По-английски

This is somehow far from competitive programming but recently I'm trying to get enrolled in a summer of code project with boost library ( an open source C++ library ), to get enrolled in the boost summer of code projects requires a competency test, mine was writing a simple C++11 vector-like class.

I've written an std::vector like class but not with all methods like that of the STL (it's not required to fully complete the class), so it would be appreciated to give any feedback about my code and tell me if any issues are found.

Thanks in advance :)

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
12 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Hi, Tensor. I looked at your code and the it seems quite clear to me. However, you have not implemented some useful functions such as erase and insert. I also don't quite understand typedef unsigned int size_type; Don't you like size_t? And finally your implementation of clear has linear complexity but it can be done in O(1) for primitive types. For more info read a post on stackoverflow