> Can you give a complete minimal example?  I just tried the
> following one, and this compiles without problems, as it should:

See below.

> Are you *using* the assignment operator for your class
> somewhere?

Not that I know of.

> Cheers
> -Gerhard

Header file for FGTable:

--- start ---

#include "FGConfigFile.h"
#include "FGXMLElement.h"
#include "FGParameter.h"
#include "FGPropertyManager.h"
#include <sstream>
#include <vector>

using std::vector;
using std::stringstream;

namespace JSBSim {

class FGTable : public FGParameter
{
public:
  ~FGTable();
  FGTable(const FGTable& table);
  FGTable (FGPropertyManager* propMan, Element* el);

  double GetValue(void) const {};
  double GetValue(double key);
  double GetValue(double rowKey, double colKey);
  double GetValue(double rowKey, double colKey, double TableKey);

  void operator<<(FGConfigFile&);
  void operator<<(stringstream&);
  FGTable& operator<<(const double n);
  FGTable& operator<<(const int n);
  inline double GetElement(int r, int c) {return Data[r][c];}
  inline double GetElement(int r, int c, int t);
  void Print(void);

private:
  enum type {tt1D, tt2D, tt3D} Type;
  double** Data;
  vector <FGTable> Tables;
  int nRows, nCols, nTables;
  int colCounter, rowCounter, tableCounter;
  int lastRowIndex, lastColumnIndex, lastTableIndex;
  double** Allocate(void);
  FGPropertyManager* const PropertyManager;

  void Debug(int from);
};
}

--- end ---

Source file snippet:

--- start ---

FGTable::FGTable(const FGTable& t) :
               PropertyManager(t.PropertyManager)
{
  Type = t.Type;
  colCounter = t.colCounter;
  rowCounter = t.rowCounter;
  tableCounter = t.tableCounter;
  nRows = t.nRows;
  nCols = t.nCols;
  nTables = t.nTables;

  Tables = t.Tables;
  Data = Allocate();
  for (int r=0; r<=nRows; r++) {
    for (int c=0; c<=nCols; c++) {
      Data[r][c] = t.Data[r][c];
    }
  }
  lastRowIndex = t.lastRowIndex;
  lastColumnIndex = t.lastColumnIndex;
  lastTableIndex = t.lastTableIndex;
}

--- end ---

The exact error message given from the Borland compiler is:

"_algobase.h": E2125 Compiler could not generate operator= for class 
'JSBSim::FGTable' in
function _STL::JSBSim::FGTable * __copy<const JSBSim::FGTable *,JSBSim::FGTable
*,int>(const JSBSim::FGTable *,const JSBSim::FGTable *,JSBSim::FGTable *,const
random_access_iterator_tag &,int *) at line 145

The exact error message given from the gcc compiler in CygWin is:

g++ -I. -Isimgear/props  -oFGTable.o -c FGTable.cpp
/usr/include/c++/3.3.1/bits/stl_algobase.h: In member function `
   JSBSim::FGTable& JSBSim::FGTable::operator=(const JSBSim::FGTable&)':
/usr/include/c++/3.3.1/bits/stl_algobase.h:241:   instantiated from `_OutputIter
std::__copy(_RandomAccessIter, _RandomAccessIter, _OutputIter,
std::random_access_iterator_tag) [with _RandomAccessIter = JSBSim::FGTable*, 
_OutputIter =
JSBSim::FGTable*]'
/usr/include/c++/3.3.1/bits/stl_algobase.h:241: error: non-static const member
   `JSBSim::FGPropertyManager* const JSBSim::FGTable::PropertyManager', can't
   use default assignment operator


_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to