Thread overview | ||||||
---|---|---|---|---|---|---|
|
April 01, 2008 Function Templates in DLL | ||||
---|---|---|---|---|
| ||||
I think it has been asked before....can a function template be exported in a dll? |
April 01, 2008 Re: Function Templates in DLL | ||||
---|---|---|---|---|
| ||||
Posted in reply to Heinz | Heinz wrote: > I think it has been asked before....can a function template be exported in a dll? currently no. theoretically.... If you were able to put a compiler in the DLL and serialize the parsed template then the only thing left over would be to suck out the type info from the calling code for the compiler.... Dang you! --> http://xkcd.com/356/ |
April 02, 2008 Re: Function Templates in DLL | ||||
---|---|---|---|---|
| ||||
Posted in reply to BCS | BCS wrote: > Heinz wrote: >> I think it has been asked before....can a function template be exported in a dll? > > currently no. > > theoretically.... > > If you were able to put a compiler in the DLL and serialize the parsed template then the only thing left over would be to suck out the type info from the calling code for the compiler.... > > > Dang you! --> http://xkcd.com/356/ Funny you mention that since that has been suggested and even worked out as a solution by Burton Radons: http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D.announce&article_id=11436 |
April 02, 2008 Re: Function Templates in DLL | ||||
---|---|---|---|---|
| ||||
Posted in reply to Robert Fraser | Robert Fraser wrote:
> BCS wrote:
>
>> Heinz wrote:
>>
>>> I think it has been asked before....can a function template be exported in a dll?
>>
>>
>> currently no.
>>
>> theoretically....
>>
>> If you were able to put a compiler in the DLL and serialize the parsed template then the only thing left over would be to suck out the type info from the calling code for the compiler....
>>
>>
>> Dang you! --> http://xkcd.com/356/
>
>
> Funny you mention that since that has been suggested and even worked out as a solution by Burton Radons:
>
> http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D.announce&article_id=11436
>
Almost, but not quite, I'm thinking more along the lines of thunk generation without the original code available. I'd "only" need access to the the symbol tables of the types the template accesses and some partially processed template code. Also rather than drop out an object file and then link that in, I'm thinking of actually compiling directly to RAM and then returning a function pointer. As I said, close, but not quite the same.
|
Copyright © 1999-2021 by the D Language Foundation