source: git/factory/include/factory/templates/ftmpl_array.h @ ee668e

Last change on this file since ee668e was ee668e, checked in by Jan Engelhardt <jengelh@…>, 11 years ago
factory/build: restore out-of-tree build support When attempting an OOT build, it fails to find <factory/cplusplus.h>, because cplusplus.h is always (even in in-tree builds) produced in "${builddir}", and not "${top_srcdir}/../factory". Furthermore, one must not rely on the basename of ${top_srcdir}, and going above ${top_srcdir} is undefined and may lead to spurious build failures. (Consider a hypothetical chroot on ${top_srcdir}). Therefore, create a directory include/factory and use -Iinclude such that <factory/*> yields a buildable state, move all exported header files there. Previous OOT build log: 17:22 seven:../factory/obj > make CXX cplusplus.o CXXLD cplusplus ./cplusplus > ./cplusplus.h ../bin/makeheader ../factory.template factory.h ../bin/makeheader ../factoryconf.template factoryconf.h YACC make all-am make[1]: Entering directory `/home/jengelh/obs/zu/home/jengelh/science/singsource/factory/obj' CXX libfactory_a-algext.o CXX libfactory_a-canonicalform.o In file included from ../cf_factory.h:12:0, from ../ ../../factory/cf_gmp.h:14:33: fatal error: factory/cplusplus.h: Ingen slik fil eller filkatalog compilation terminated. make[1]: *** [libfactory_a-canonicalform.o] Error 1 make[1]: Leaving directory `/home/jengelh/obs/zu/home/jengelh/science/singsource/factory/obj' make: *** [all] Error 2
  • Property mode set to 100644
File size: 934 bytes
[6ab5981]1/* emacs edit mode for this file is -*- C++ -*- */
[341696]2/* $Id$ */
4#ifndef INCL_ARRAY_H
5#define INCL_ARRAY_H
[e4fe2b]7// #include <factory/factoryconf.h>
[175e355]9#ifndef NOSTREAMIO
[1dc616]10#ifdef HAVE_IOSTREAM
11#include <iostream>
[181148]12#define OSTREAM std::ostream
[1dc616]13#elif defined(HAVE_IOSTREAM_H)
[684544]14#include <iostream.h>
[181148]15#define OSTREAM ostream
[175e355]17#endif /* NOSTREAMIO */
19template <class T>
20class Array {
22    T * data;
23    int _min;
24    int _max;
25    int _size;
27    Array();
28    Array( const Array<T>& );
29    Array( int size );
30    Array( int min, int max );
31    ~Array();
32    Array<T>& operator= ( const Array<T>& );
33    T& operator[] ( int i ) const;
34    int size() const;
35    int min() const;
36    int max() const;
[175e355]37#ifndef NOSTREAMIO
[181148]38    void print ( OSTREAM& ) const;
[175e355]39#endif /* NOSTREAMIO */
[175e355]42#ifndef NOSTREAMIO
[684544]43template <class T>
[181148]44OSTREAM& operator<< ( OSTREAM & os, const Array<T> & a );
[175e355]45#endif /* NOSTREAMIO */
[6ab5981]47#endif /* ! INCL_ARRAY_H */
Note: See TracBrowser for help on using the repository browser.