Porting 'operator' to Obj-C
Porting 'operator' to Obj-C
- Subject: Porting 'operator' to Obj-C
- From: "Alex Finkel" <email@hidden>
- Date: Fri, 26 Sep 2008 11:03:40 -0400
Hi there.
I am in a process of porting some C++ code to ObjC. How to port the code
bellow (operators). Thanks.
typedef struct encoding_tag
{
byte encodings[ 16 ];
ushort count;
encoding_tag() { count = 0; }
encoding_tag( encoding_tag& encoding ) { *this = encoding; }
void operator = ( encoding_tag& encoding )
{
count = encoding.count;
for ( int i = 0; i < count; i++ )
encodings[i] = encoding.encodings[i];
}
bool operator == ( encoding_tag& cmp )
{
if ( count != cmp.count ) return false;
return (*this <= cmp);
}
bool operator != ( encoding_tag& cmp )
{
return !(*this == cmp);
}
} ENCODING;
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden