Re: More fun with C++
Re: More fun with C++
- Subject: Re: More fun with C++
- From: "Herb Petschauer" <email@hidden>
- Date: Thu, 3 Apr 2008 16:21:56 -0700
Ah, we can easily go to the loony bin with this one. You have to start doing:
typedef struct Foo
{
Byte a;
} Foo;
#ifdef __cplusplus
class Bar
{
private:
Foo mFoo;
};
#endif
or just refactor your code and (in this case) add a ProjectTypes.h
which contains common structures and types (common to all 3 languages:
C++, Obj-C, C).
But remember, we got to this state because we tried to do a retro fit
(aka kludge). Do a proper MVC (Model, View, Controller) and you can
have a C++ data model ("back end") with a
Cocoa/PowerPlant/MFC/Whatever front end. Hell, wrap the data model
with Obj-C if you want.
(also discussed to death in the archives).
Cheers,
-H.
On 03/04/2008, Scott Ribe <email@hidden> wrote:
> > #ifdef __cplusplus
> >
> > C++ stuff
> >
> > #endif
>
>
> As long as you don't need to reference the C++ stuff from a .m file. But
> then, should the header even be included by any .m files? Sure, there are
> times when C++ and non-C++ stuff might belong together in a header, but most
> of the time my C++ headers are all C++...
>
>
> --
> Scott Ribe
> email@hidden
> http://www.killerbytes.com/
> (303) 722-0567 voice
>
>
>
> _______________________________________________
>
> 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
>
_______________________________________________
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