I need to write bindings for a POD C++ class.
This class has a few overloaded operators, and I want to generate bindings for them as well.
However, it seems like bindgen
simply ignores them.
Are those not supported? I couldn't find anything in the documentation:
class Wrapped
{
public:
explicit Wrapped(float x):
data()
{
data = x;
}
Wrapped& operator/=(float scalar)
{
data /= scalar;
return *this;
}
private:
float data;
};
Wrapped operator/(Wrapped v, float scalar)
{
return Wrapped(v) /= scalar;
}
Generates:
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Wrapped {
pub data: f32,
}
extern "C" {
#[link_name = "\u{1}??0Wrapped@@QEAA@M@Z"]
pub fn Wrapped_Wrapped(this: *mut Wrapped, x: f32);
}
Would be glad for any help!