- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Good afternoon.
I have a question concerning use keyword export the templates. I want to share template advertisement and its implementation using the keyword export (do not want to pull very large .h files).
For example like this all works:
Tell my how to use correct export.
Thanks in advance.
I have a question concerning use keyword export the templates. I want to share template advertisement and its implementation using the keyword export (do not want to pull very large .h files).
For example like this all works:
[bash]#ifndef ETEMPLATE_H #define ETEMPLATE_H templatevoid SomeFnc (T const&); #include "ETemplate.cpp" #endif // ETEMPLATE_H[/bash]
[bash]//ETemplate.cppBut by using the export i have errors:
#include "stdafx.h" templatevoid SomeFnc (T const& x) { printf("All work\n"); }[/bash]
[bash]#ifndef ETEMPLATE_H #define ETEMPLATE_H export templatevoid SomeFnc (T const&); #endif // ETEMPLATE_H[/bash]
[bash]//ETemplate.cpp #include "stdafx.h" #include "ETemplate.h" export templatevoid SomeFnc (T const& x) { printf("Dont work\n"); }[/bash]
Tell my how to use correct export.
Thanks in advance.
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
export template is not implemented on our Windows platform.
It is implemented on our Linux platforms (if you use the -export switch) but you might want to think twice about using it, I would recomment that you read:
http://std.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1426.pdf
My advice:
If it's compile time you're worried about, use precompiled headers.
If it's name pollution, use namespaces.
Judy
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
export template is not implemented on our Windows platform.
It is implemented on our Linux platforms (if you use the -export switch) but you might want to think twice about using it, I would recomment that you read:
http://std.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1426.pdf
My advice:
If it's compile time you're worried about, use precompiled headers.
If it's name pollution, use namespaces.
Judy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the advice.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page