コード例 #1
0
ファイル: SmartPointerList.hpp プロジェクト: Xertz/Vulkan
    VkBool32 insert(const size_t index, const V& value)
    {
        auto walker = front;
        auto counter = 0;

        while (walker && counter + 1 < index)
        {
            walker = walker->next;

            counter++;
        }

        if (counter != index)
        {
            return VK_FALSE;
        }

        if (!walker)
        {
            return emplaceBack(value);
        }

        if (!walker->prev)
        {
            return emplaceFront(value);
        }

        auto newElement = new SmartPointerListElement<V>(value);

        if (!newElement)
        {
            return VK_FALSE;
        }

        newElement->prev = walker->prev;
        walker->prev = newElement;

        newElement->prev->next = newElement;
        newElement->next = walker;

        listSize++;

        return VK_TRUE;
    }
コード例 #2
0
ファイル: arrayqueue.hpp プロジェクト: songhtdo/vespa
 /**
  * Insert an item at the front of this queue.
  *
  * @param item the item to insert
  **/
 void pushFront(T &&item) {
     emplaceFront(std::move(item));
 }
コード例 #3
0
ファイル: arrayqueue.hpp プロジェクト: songhtdo/vespa
 /**
  * Insert an item at the front of this queue.
  *
  * @param item the item to insert
  **/
 void pushFront(const T &item) {
     emplaceFront(item);
 }