Re: [Dev-C++] Export keyword problem
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Jason H. <jas...@nt...> - 2002-06-13 22:25:29
|
Here's a qoute from a reference I have:
"The export keyword can precede a template declaration. It allows other files to use a template
declared in a different file by specifying only its declaration rather than duplicating its entire
definition."
If I remember correctly this feature is very new and not implemented in many compilers yet. It's to
do with the fact that old style binaries/libraries didn't have the ability to represent a templated
function within themselves, they could only represent a template function that had been targetted to
a specific type at compile time, i.e. int, float, MyClass, etc...
Also of interest:
"extern is a data type modifier that tells the compiler about a variable that is defined elsewhere
in a program. This is often used in conjunction with separately compiled files that share the same
global data. In essence, it notifies the compiler about the type of a variable without redefining
it......."
"For C++ only, extern is also used to create a linkage specification......"
Hope this helps,
Jason.
----- Original Message -----
From: "Mac Reiter" <re...@no...>
To: <dev...@li...>
Sent: Thursday, June 13, 2002 10:38 PM
Subject: Re: [Dev-C++] Export keyword problem
>The book C++ Primer, 3rd edition, Lippmann and Lajoie, speaks on two
>models of compilation: separation and inclusion. The separation model
>defines a function in a separate file and it becomes available with the
>keyword export. I tested this in the Dev and it did not work. The
I do not have this book available, but in a fair number of years of C and
C++ programming, I have never heard of the "export" keyword, except for DLL
creation in Microsoft compilers. The closest I can think of is the
"extern" keyword, but it is used to import things from other compilation
units, and it is _not_ needed to get access to functions.
Could you give one or more quotes from your book, preferably with small
code examples if possible?
Mac
-
_____________________________ /"\
Mac Reiter \ / ASCII Ribbon Campaign
Nomadics, Inc. X Against HTML Mail
re...@no... / \ (To join the campaign, simply use
this in your signature.)
_______________________________________________________________
Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|