Moving into c++

Jul 17, 2013 at 7:18am

Moving into c++

Hi, just about to start moving some of my stuff from Java/Javascript into C++.

Just wondering whether classes need to be created using an allocator that goes through the C allocation routines (sysmem_newptr etc), whether standard new is ok?

thx Lee

#256278
Jul 17, 2013 at 8:23am

Hi,

You can use C++ as usual in your external (new, delete …) as soon it concerns your own classes. The only things you will need to care about is how to bind/wrap all that with the max structure.

For that you can use:

  1. Graham Wakefield templates ( https://github.com/grrrwaaa/maxcpp )
  2. or smart pointers ( https://github.com/nicolasdanet/Flop/blob/master/Sources/Flop/flopAutoPtr.cpp )
  3. or like JKC here ( http://cycling74.com/forums/topic/c-vtable-and-t_object/ )
  4. or whatever you want. So many men, so many opinions.
#256288
Jul 17, 2013 at 8:35am

great, that’s what I thought, just wanted to make sure… cheers for the speedy reply… looking forward to giving this a bash!

#256291
Jul 17, 2013 at 8:54am

Hi,

I forget to refer to the collect.cpp example in the SDK ;-)

#256292

You must be logged in to reply to this topic.