Hi, I want to know how i can create a template library without explicit the code above??... i know all the problem that a template class or a template function has at compile time, that a compiler doesn't generate a code if no template object is instantiated.. but, how i can create my library without giving my code to anyone??
thanks and sorry for my english.. XD..
p.s.
I use netbeans 7.1 to code.. (if that can help you)..
You can't. The part doing templates in C++ compiler is just a dumb source code preprocessor (no, not the one doing #includes but another, similar in smartness). It operates on source code, not intermediate / target code. However you can call non-templated code from a template and make that non-templated code delivered in binary-only form.
If you have a list of types which the template will be instantiated for, then you can instantiate those types in the library and as long as the program only uses the templates for those types it'll be fine.