STL set inside inside a class
STL set inside inside a class
- Subject: STL set inside inside a class
- From: mark <email@hidden>
- Date: Thu, 18 May 2006 09:48:10 +1200
Title: STL set inside inside a class
Hello.
I have a class with a set defined in it.
class
GenericTree {
TreeObjectRef
*toBlock; // 0 is usually the
root
UInt16
refCount;
UInt16
maxItems;
void* root;
UInt16
itemCount;
std::map<const
int, UInt16> depthCount; // number of objects at depth X
...
}
And a method in the class
void
GenericTree::CalcDepthRecursive(SInt16 index, SInt16 depth) {
UInt16
t;
if
(depth>maxDepth) {return;}
...
std::map<const
int, UInt16>::iterator
end=depthCount.end();
if
(depthCount.find(depth)!=end) {
depthCount[depth]++;
}
else {
depthCount[depth]=1; (1)
}
...
};
}
(1) causes an EXC_BAD_ACCESS somewhere deep inside the bowels of
set.
If the depthCount is not in a class, it works fine,
operator--()
{
_M_node =
_Rb_tree_decrement(_M_node); <<< here
return *this;
}
Is this an implementation issue for set or
doesn't set like living inside a class?
I have only started using STL
receently.
XCode 2.2.1, OS 10.4.6
TIA
Mark
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden