RE: Obj-C++ Tuturial Anywhere?
RE: Obj-C++ Tuturial Anywhere?
- Subject: RE: Obj-C++ Tuturial Anywhere?
- From: "Todd Blanchard" <email@hidden>
- Date: Wed, 15 Aug 2001 15:03:12 -0700
Sure - here is my guidelines.
1) Minimize the use of C++ constructs as much as possible - zero is ideal.
2) Don't export C++ interfaces in your frameworks - only export Objective C
wrappers.
3) When considering the use of templates, see 1.
4) Ditto operator overloading.
5) The only other good use might be the following "smart releasing pointer"
class:
class Id
{
id _object;
Id(id obj) : _object([obj retain]) {}
~Id() { [_object release]; }
operator id() { return _object; }
}
...
{
Id foo = [MyClass newObject];
} // destructor releases foo
This might not work though - I haven't tried it as I don't have the new
thingy.
-----Original Message-----