Unboxing while embedding Julia in C++?

I will post my personal solution. I ended up changing the array to:

4x1 Array{Array{Int64,1},1}:

And then the following code would work:

    jl_function_t *RangeList = jl_get_function(modJulia,"RangeSearch");

    jl_array_t *retRL = (jl_array_t *)jl_call2(RangeList,(jl_value_t*)pre_data,jl_box_float64(0.1));
    
    // Protect `var` until we add its reference to `refs`.
    JL_GC_PUSH1(&retRL);

    const size_t nsize = jl_array_dim(retRL,0);
    int64_t* p = (int64_t*)jl_array_data(retRL);
    
    JL_GC_POP();

There is a small error in the documentation, it will not work, if you do not add “(jl_value_t*)” infront of your data pointer, in this case, data_pre.

Kind regards