Hi Ronny, > Is it possible using the current EMBIND to pass one CPP class to another? > For example: > Here I tried constructing class Bar in the same binding declaration as Foo, > and construct a Bar using Foo. > Is it possible at all, and if yes how? > Thanks > Ronny > > > EMSCRIPTEN_BINDINGS(Test) { > emscripten::class_<Foo>("Foo"). > constructor<const char*, const char*, const char*>(). > emscripten::class_<Bar>("Bar"). > constructor<Foo>(); > }
Sure is it possible, if you pass in the class as raw or smart pointer: EMSCRIPTEN_BINDINGS(Test) { emscripten::class_<Foo>("Foo"). constructor<const char*, const char*, const char*>(); emscripten::class_<Bar>("Bar"). constructor<Foo *>(); } Watch out to terminate a class declaration properly. If I'm not wrong then you cannot bind a new class to the result of a constructor call of a previous class. Mike -- www.soft-gems.net -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/2251F5AB-EA87-49B8-A0A2-DCC71A43B008%40googlemail.com.