Function Templates in DLL

BCS BCS at pathlink.com
Wed Apr 2 10:50:01 PDT 2008


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.


More information about the Digitalmars-d-learn mailing list