openexr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Openexr-devel] Question about class Array


From: qtech qtech
Subject: [Openexr-devel] Question about class Array
Date: Thu, 26 Oct 2017 06:01:30 +0000

I am an inexperienced programmer trying to build and use openexr. I think my main problem is the linking. So I have this header file:

#ifndef INCLUDED_IMF_ARRAY_H
#define INCLUDED_IMF_ARRAY_H
#include "ImfForward.h"
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER
template <class T>
class Array
{
  public:
     Array ()               {_data = 0; _size = 0;}
     Array (long size)          {_data = new T[size]; _size = size;}
    ~Array ()               {delete [] _data;}
    operator T * ()         {return _data;}
    operator const T * () const     {return _data;}
    void resizeErase (long size);
    void resizeEraseUnsafe (long size);
    long size() const   {return _size;}
  private:
    Array (const Array &);  
    Array & operator = (const Array &);
    long _size;
    T * _data;
};

and my main file is

#include <iostream>
#include <OpenEXR/ImfArray.h>
using namespace std;
struct C
{
    C ()        {std::cout << "C::C  (" << this << ")\n";};
    virtual ~C ()   {std::cout << "C::~C (" << this << ")\n";};
};
int main ()
{
    Array <C> a(3);

    C &b = a[1];
    const C &c = a[1];
    C *d = a + 2;
    const C *e = a;
    return 0;
}

I keep getting the following error "‘Array’ was not declared in this scope"... I would really appreciate your help! Thank you in advance

Thank you,
Stelio

reply via email to

[Prev in Thread] Current Thread [Next in Thread]