If I define a struct, and I want to pass a string to a function with a parameter of type that very struct, is there any way to arrange that an implicit conversion occurs, assuming a function that maps a string to that struct type exists?

struct data { ........ }

void f( data x) { .... }

void main() {
    data( "hello"); //convert argument implicitly to type `data`.
}

It's possible to arrange for such an implicit conversion from an existing type to a newly defined type during assignment, but what about when passing an argument to a function?

Reply via email to