File: IIntvec.h

package info (click to toggle)
singular 1%3A4.1.1-p2%2Bds-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 35,856 kB
  • sloc: cpp: 288,280; ansic: 17,387; lisp: 4,242; yacc: 1,654; python: 1,608; makefile: 1,424; lex: 1,387; perl: 632; sh: 567; xml: 182
file content (33 lines) | stat: -rw-r--r-- 664 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef ITERATABLE_INTVEC_H
#define ITERATABLE_INTVEC_H
#include <vector>
#include "misc/intvec.h"
class Intvec: public std::vector<int>
{
public:
  Intvec(iterator first,
        iterator last,
        const allocator_type& __a = allocator_type()):
    std::vector<int>(first,last,__a){}
  Intvec(int n=0):std::vector<int>(n){}
  Intvec(intvec& iv):std::vector<int>(iv.length())
  {
    int n=iv.length();
    for(int i=0;i<n;i++)
    {
      (*this)[i]=iv[i];
    }
  }
  intvec* allocate_legacy_intvec_copy() const
  {
    int s=size();
    intvec* iv=new intvec(s);

    for(int i=0;i<s;i++)
    {
      (*iv)[i]=(*this)[i];
    }
    return iv;
  }
};
#endif