I have this data type:
If I try this:
I get this:
That's because an ASH map has a to_string() method:
But I'm not actually trying to override the built-in array's version of to_string. I am trying to define one for my typedef.
Almost everywhere, a typedef is interchangeable with its base type. I'm wondering if it'd be worth it to make two passes over the symbol table when looking up the matching function when you pass in an object defined by a typedef: an exact match for the typedef and a match for the base type?
That grows exponentially with the number of typedefs you include in your argument list: 2, 2*2, 2*2*2, etc.
Code:
typedef string [int] beach_layout;
If I try this:
Code:
string to_string( beach_layout layout )
{
...
}
Code:
[color=red]Function 'to_string( string [int] )' defined multiple times (BeachComber.ash, line 226)[/color]
Code:
[color=green]> ash string[int]a = { 1:"abc" };a.to_string()[/color]
Returned: aggregate string [int]
Almost everywhere, a typedef is interchangeable with its base type. I'm wondering if it'd be worth it to make two passes over the symbol table when looking up the matching function when you pass in an object defined by a typedef: an exact match for the typedef and a match for the base type?
That grows exponentially with the number of typedefs you include in your argument list: 2, 2*2, 2*2*2, etc.