source: git/factory/templates/ftmpl_array.h @ 1dc616

spielwiese
Last change on this file since 1dc616 was 1dc616, checked in by Hans Schönemann <hannes@…>, 17 years ago
*hannes: test for iostream and iostream.h git-svn-id: file:///usr/local/Singular/svn/trunk@9134 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 925 bytes
Line 
1/* emacs edit mode for this file is -*- C++ -*- */
2/* $Id: ftmpl_array.h,v 1.6 2006-05-15 08:17:56 Singular Exp $ */
3
4#ifndef INCL_ARRAY_H
5#define INCL_ARRAY_H
6
7#include <factoryconf.h>
8
9#ifndef NOSTREAMIO
10#ifdef HAVE_IOSTREAM
11#include <iostream>
12#elif defined(HAVE_IOSTREAM_H)
13#include <iostream.h>
14#endif
15#endif /* NOSTREAMIO */
16
17template <class T>
18class Array {
19private:
20    T * data;
21    int _min;
22    int _max;
23    int _size;
24public:
25    Array();
26    Array( const Array<T>& );
27    Array( int size );
28    Array( int min, int max );
29    ~Array();
30    Array<T>& operator= ( const Array<T>& );
31    T& operator[] ( int i ) const;
32    int size() const;
33    int min() const;
34    int max() const;
35#ifndef NOSTREAMIO
36    void print ( ostream& ) const;
37#endif /* NOSTREAMIO */
38};
39
40#ifndef NOSTREAMIO
41template <class T>
42ostream& operator<< ( ostream & os, const Array<T> & a );
43#endif /* NOSTREAMIO */
44
45#endif /* ! INCL_ARRAY_H */
Note: See TracBrowser for help on using the repository browser.