Topic: export" keyword


Author: bgera@hotmail.com (Bond)
Date: Tue, 29 Jan 2002 10:26:06 CST
Raw View
Ron Natalie <ron@sensor.com> wrote in message news:<3C4D98AC.2F889525@sensor.com>...
> EA wrote:
> > Is this keyword a C++ standard?
>
> Yes.
>
> > MS Visual C++ compiler seems not to recognize such a keyword.
>
> It's a bit problematic to implement, and MS VC++ is in good
> company with people who fail to handle it.
>
> ---
> [ comp.std.c++ is moderated.  To submit articles, try just posting with ]
> [ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
> [              --- Please see the FAQ before posting. ---               ]
> [ FAQ: http://www.research.att.com/~austern/csc/faq.html                ]


Hi:
I would like to know , in case of a normal function call ,
if the declaration is there ina .h file and if it is included in other
.cpp/compilation units it is declared in the latter also ( basically
declaration present ). In case of fuinction templates also similar
must hold.

So why have "export"? just if other compilation units have no such
header
file declarations? I doubt if any such thing can be possible?

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html                ]





Author: Michiel.Salters@cmg.nl (Michiel Salters)
Date: Wed, 30 Jan 2002 10:17:10 CST
Raw View
bgera@hotmail.com (Bond) wrote in message news:<8e2f7846.0201290452.5c76ef2e@posting.google.com>...

> Hi:
> I would like to know , in case of a normal function call ,
> if the declaration is there ina .h file and if it is included in other
> .cpp/compilation units it is declared in the latter also ( basically
> declaration present ). In case of fuinction templates also similar
> must hold.

In case of a normal function, the declaration is in a header file,
so all .cpp file can include the header file to get the declaration.
The definition ( == the code ) is tucked away in one .cpp file.

No so for function templates; in the absence of "export" the
definition must go into the header, and the definition ends up
in all .cpp files including that header.

By using "export" the function template definition can be moved
to a separate .cpp file. However, this is very complicated for a
compiler, so no publicly available compiler supports "export"
yet. But that should be a thing of the past Real Soon Now.

HTH,
--
Michiel Salters

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html                ]





Author: "EA" <eassenza@hotmail.com>
Date: Tue, 22 Jan 2002 16:44:10 GMT
Raw View
Hello,
In the C++ Stroustrup book I read that the "export" keyword
can be used to make available a template function defined in
a .cpp file to other compilation units. Is this keyword a C++ standard?
MS Visual C++ compiler seems not to recognize such a keyword.

Thank you,
Emanuele



---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html                ]





Author: Ron Natalie <ron@sensor.com>
Date: Tue, 22 Jan 2002 16:50:01 GMT
Raw View

EA wrote:
> Is this keyword a C++ standard?

Yes.

> MS Visual C++ compiler seems not to recognize such a keyword.

It's a bit problematic to implement, and MS VC++ is in good
company with people who fail to handle it.

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html                ]