// Copyright (c) 2022 Dominic Masters // // This software is released under the MIT License. // https://opensource.org/licenses/MIT #pragma once #include "dawnsharedlibs.hpp" #include "assert/assert.hpp" namespace Dawn { /** * Append a list on to another list. * * @param list Pointer to list that is being appended to. * @param append Pointer to list that will be appended. */ template void vectorAppend(std::vector *list, std::vector *append) { assertNotNull(list, "vectorAppend: list cannot be null"); assertNotNull(append, "vectorAppend: append cannot be null"); auto it = append->begin(); while(it != append->end()) { list->push_back(*it); ++it; } } /** * Append a list on to another list. * * @param list Pointer to list that is being appended to. * @param append List that will be appended. */ template void vectorAppend(std::vector *list, std::vector append) { assertNotNull(list, "vectorAppend: list cannot be null"); auto it = append.begin(); while(it != append.end()) { list->push_back(*it); ++it; } } }