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 (unsigned int i = static_cast<unsigned int>(v.size()); i--;) (*this)[i] = v[i];
18}
19
20ASTIntVecO* ASTIntVecO::a(const std::vector<int>& v) {
21 ASTIntVecO* ao = static_cast<ASTIntVecO*>(alloc(sizeof(int) * v.size()));
22 new (ao) ASTIntVecO(v);
23 return ao;
24}
25
26} // namespace MiniZinc