On Wed, Jul 10, 2013 at 11:39 AM, Adam D. Ruppe
<[email protected]>wrote:

> On Wednesday, 10 July 2013 at 17:44:51 UTC, Timothee Cour wrote:
>
>> * One use case is using it in shared libraries:
>> user asks for a symbol via its demangled string representation (which is
>> most natural for user), then the string is mangled, and then calls dlsym to
>> retrieve the actual pointer to symbol in the shared lib.
>>
>
> I think in this case, it would be better to use .mangleof anyway because
> you'll want that type safety. You could still compare a user inputted
> string to typeof(S).stringof if you want to choose one at runtime.
>

How would that work, since this is runtime only? I'm interested in the case
where I don't have access to said symbol, all I have is a string
representation of it. For example when using dlopen on a library where we
don't have source code; so in this case typeof(S) doesn't make sense.

Reply via email to