Sponsored Content
Top Forums Programming Problems with template instantiation in C++ Post 302343101 by MartinM09 on Tuesday 11th of August 2009 03:01:05 PM
Old 08-11-2009
I thank you for your help.

Quote:
The first several lines about the "export" keyword should be pretty clear: "export", used to enable a separation of declaration and definition of template classes/functions, is not supported by GCC.
A common work around to avoid this deprecated keyword and still stay on top of things is to do sort of a reverse include: Provide prototypes (with normal header extension) and definitions (usually with an "impl" ext.) in distinct files as usual but include the implementation file at the end of the header file. This is necessary as template instantiation requires presence of definition so it can instantiate the template "in one go".
I know, that g++ doesn't support the export keyword. But as time goes, this fact can be changed, or this keyword will be abolished. Therefore the I included this feature.
I have shorten the code to publish it on this forum. In the real world this file is scattered over several files. The core module of this project is about 20000 lines. Every additional module can be rough about 100 000 lines or the multiple size. Therefore I concluded to separate the compile units.

Quote:
Another error I spotted at a quick glance is linked with the very last function. Am I right in assuming it should be a total specialization of the function above? Then it should read "template <>". Of course, also here the function's definition is missing.
I have included the "<>" glyphes into the code. The result is, that the compile errors go away. But I have looked into the object file with the nm tool and I couldn't seen any instantiate function. That is not really what I intended.

MartinM09.
 

6 More Discussions You Might Find Interesting

1. Programming

About template constraints

Hi, i have class template, 1)can i override the copy constructor 2)can we have virtual function in class template if not plz tel why? I tried , compile error comes for me... Thanks Sarwan (0 Replies)
Discussion started by: sarwan
0 Replies

2. UNIX for Dummies Questions & Answers

vi calling template

Hello. I want to copy temp files when I make a new file by vi. For example, 09:32:52 ~/ $ mkdir test 09:33:03 ~/ $ cd test/ 09:33:09 ~/test/ $ ls 09:33:16 ~/test/ $ vi test.cpp 09:34:37 ~/test/ $ cat test.cpp #include <iostream> int main() { } 09:34:48 ~/test/ $ vi test.bash 09:35:19... (1 Reply)
Discussion started by: Euler04
1 Replies

3. Programming

Template problem ...

Hi all, Need your help. I am doing a simple template program , getting some error ... here is the code #include <iostream> #include <stdio.h> #include <stdlib.h> #include<iostream> #include<string> #include <sstream> using namespace std; class Base_class { public: Base_class(){... (1 Reply)
Discussion started by: amartya_sock
1 Replies

4. Shell Programming and Scripting

Help with template like solution

hi experts, i'm trying to do this: file1 is a template. might have kinds of 'funny' characters. sample: <body> <form> <p><input type="text" name="abc"/></p> &nbsp; <p><my_content></p> </form> </body> file2 is a file that contains lots of text. this might be very big. might have... (2 Replies)
Discussion started by: xjohnu
2 Replies

5. Programming

C++ template error

I get some compiling errors about template instantiation :wall: , but I can't find where the syntax errors happens. Can some help me? template<typename Type> class SingleList; template<typename Type> class SingleListNode{ private: friend class SingleList<Type>; SingleListNode() :... (1 Reply)
Discussion started by: 915086731
1 Replies

6. Programming

Calling template at once

Hello Again, I am just wanted to know if we can call the Template using "require_once" at PHP? Any views around happy to discuss. Thanks in Advance (2 Replies)
Discussion started by: AimyThomas
2 Replies
PYDOC(1)						    BSD General Commands Manual 						  PYDOC(1)

NAME
pydoc -- the Python documentation tool SYNOPSIS
pydoc name pydoc -k keyword pydoc -p port pydoc -g pydoc -w module ... pydoc --help DESCRIPTION
pydoc shows text documentation on something related to python(1). The name argument may be the name of a Python keyword, topic, function, module, or package, or a dotted reference to a class or function within a module or module in a package. If name contains a '/', it is used as the path to a Python source file to document. If name is 'keywords', 'topics', or 'modules', a listing of these things is displayed. OPTIONS
-k keyword Search for a keyword in the synopsis lines of all available modules. -p port Start an HTTP server on the given port on the local machine. -g Pop up a graphical interface for finding and serving documentation. -w module ... Write out the HTML documentation for a module to a file in the current directory. If module contains a '/', it is treated as a filename; if it names a directory, documentation is written for all the contents. --help Prints out a help message. AUTHOR
Moshe Zadka, based on "pydoc --help" SEE ALSO
python(1) Dec 19, 2003
All times are GMT -4. The time now is 09:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy