I'm sure this has been asked before, but I cannot find it in the archives.
I cannot seem to use an NcFile object as a class member. If I do the
following (shortened for clarity), I get a NcBadId exception:
class Trync
{
public:
Trync()
{
fooFile = NcFile("foo.nc",NcFile::replace);
int a = 1;
fooFile.putAtt("bar", ncInt, size_t(1), &a);
}
NcFile fooFile;
};
int main()
{
Trync tnc;
return 0;
}
To be clear, the exception happens even without the putAtt command. It just
happens during the destruction of fooFile. I've looked at the definition of
operator=() and it does seem to correctly copy myId from its rhs. Does
anybody know what's going on, and is there a workaround?
Thanks