this repo has no description
1/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2
3/*
4 * Main authors:
5 * Guido Tack <guido.tack@monash.edu>
6 */
7
8/* This Source Code Form is subject to the terms of the Mozilla Public
9 * License, v. 2.0. If a copy of the MPL was not distributed with this
10 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
11
12#include <minizinc/astvec.hh>
13
14namespace MiniZinc {
15
16ASTIntVecO::ASTIntVecO(const std::vector<int>& v) : ASTChunk(sizeof(int) * v.size()) {
17 for (auto i = static_cast<unsigned int>(v.size()); (i--) != 0U;) {
18 (*this)[i] = v[i];
19 }
20}
21
22ASTIntVecO* ASTIntVecO::a(const std::vector<int>& v) {
23 auto* ao = static_cast<ASTIntVecO*>(alloc(sizeof(int) * v.size()));
24 new (ao) ASTIntVecO(v);
25 return ao;
26}
27
28} // namespace MiniZinc