Re: How are (Static) Libraries with Templates Compiled?

2019-03-12 Thread Jacob Carlborg via Digitalmars-d-learn
On 2019-03-11 21:59, jmh530 wrote: Ah, so you need the .lib files and the .di files to get it work. You need the .di or .d files regardless if it's a template or not. Because you need to know which declarations are available. In addition to that, for templates the source (and not just the

Re: How are (Static) Libraries with Templates Compiled?

2019-03-11 Thread jmh530 via Digitalmars-d-learn
On Monday, 11 March 2019 at 20:11:37 UTC, ag0aep6g wrote: On Monday, 11 March 2019 at 19:53:53 UTC, jmh530 wrote: So what information is in the static library that allows this to take place? None. The information is in in the source or interface file (.d/.di). Templates can't be compiled

Re: How are (Static) Libraries with Templates Compiled?

2019-03-11 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Mar 11, 2019 at 07:53:53PM +, jmh530 via Digitalmars-d-learn wrote: > Suppose I have a file with a simple templated function. I compile that > to a static library. I then compile another file that uses the library > into an executable. When compiled to the static library, you don't >

Re: How are (Static) Libraries with Templates Compiled?

2019-03-11 Thread ag0aep6g via Digitalmars-d-learn
On Monday, 11 March 2019 at 19:53:53 UTC, jmh530 wrote: So what information is in the static library that allows this to take place? None. The information is in in the source or interface file (.d/.di). Templates can't be compiled before they're instantiated.

How are (Static) Libraries with Templates Compiled?

2019-03-11 Thread jmh530 via Digitalmars-d-learn
Suppose I have a file with a simple templated function. I compile that to a static library. I then compile another file that uses the library into an executable. When compiled to the static library, you don't know in advance what types it will call on the templated function, so that must be