Hi, 

My problem isn't very hard. I think that Embind can't handle this, but 
after some research, I prefer ask to the community to be sure !

I have a C++ function with a optional parameter :

bool my_function(int a, bool b = false)

And i'm trying to translate this function with embind ! But I don't know 
how to specify the optional value.

I tried differents solutions :

class_<Blabla>("Blabla")
 .constructor<int>()
 .function("my_function", &Blabla::my_function);

Here, I can't call the function without the last parameter.

class_<Blabla>("Blabla")
 .constructor<int>()
 .function("my_function", select_overload<bool(int)>(&Blabla::my_function))
 .function("my_function", select_overload<bool(int, 
bool)>(&Blabla::my_function));

Here, don't even compile. I got "error : no matching function for call to 
'select_overload'"

All what i want is the possibility to call my function with AND without the 
last parameter.

Do you know if this is possible ?

Thanks anyway  

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to