c++ - Explicit Template Specification
- John Fletcher (27/27) Oct 10 2001 I have some code which I have used for some time with Symantec and now
- Walter (2/29) Oct 10 2001
- John Fletcher (6/16) Oct 11 2001 At the moment I define TT as empty for DMC and that works.
- Walter (5/8) Oct 11 2001 Over time, I intend to bring it into full conformance with C++ 98. I don...
- John Fletcher (12/20) Oct 11 2001 O.K. I think that conformance will force you to make that change at som...
- Walter (5/6) Oct 11 2001 What kind of examples do you have? Are they in a form that can be
- Jan Knepper (4/10) Oct 11 2001 In the SGI-STL.tar.gz is a directory SC with about 18 test programs...
I have some code which I have used for some time with Symantec and now DM C++. This code has template classes with frien operators such as template <class T> class Complex { ...... public: friend ostream & operator<< (ostream&, const Complex<T>&); }; When I moved this code to gcc I found that the definition had to be changed to template <class T> class Complex { ...... public: friend ostream & operator<< <> (ostream&, const Complex<T>&); }; for the function a template friend. This change is a consequence (as I understand it) of "Explicit Template Specification". It makes code which used to work not work. How is this going to be handled in the development of DM? At the moment I have in my code things like this: friend ostream & operator<< TT (ostream&, const Complex<T>&); where TT has to be given an appropriate define. Cheers John
Oct 10 2001
Does it no longer work with DMC? John Fletcher wrote in message <3BC45E1C.D684997A aston.ac.uk>...I have some code which I have used for some time with Symantec and now DM C++. This code has template classes with frien operators such as template <class T> class Complex { ...... public: friend ostream & operator<< (ostream&, const Complex<T>&); }; When I moved this code to gcc I found that the definition had to be changed to template <class T> class Complex { ...... public: friend ostream & operator<< <> (ostream&, const Complex<T>&); }; for the function a template friend. This change is a consequence (as I understand it) of "Explicit Template Specification". It makes code which used to work not work. How is this going to be handled in the development of DM? At the moment I have in my code things like this: friend ostream & operator<< TT (ostream&, const Complex<T>&); where TT has to be given an appropriate define. Cheers John
Oct 10 2001
Walter wrote:Does it no longer work with DMC?At the moment I define TT as empty for DMC and that works. My question is, will it change? Also, the latest version of DM 8.1f does break some STL code with map and set which previously worked. JohnHow is this going to be handled in the development of DM? At the moment I have in my code things like this: friend ostream & operator<< TT (ostream&, const Complex<T>&); where TT has to be given an appropriate define.
Oct 11 2001
John Fletcher wrote in message <3BC55E8F.52955430 aston.ac.uk>...My question is, will it change?Over time, I intend to bring it into full conformance with C++ 98. I don't know at the moment if that means yes or no to your question <g>.Also, the latest version of DM 8.1f does break some STL code with map andsetwhich previously worked.Try #defining the ARROW workaround in stl_config.h.
Oct 11 2001
Walter wrote:John Fletcher wrote in message <3BC55E8F.52955430 aston.ac.uk>...O.K. I think that conformance will force you to make that change at some point. I have found in the stl_config.h a define called __STL_EXPLICIT_FUNCTION_TMPL_ARGS which if set does this: #define __STL_NULL_TMPL_ARGS <> and otherwise defines it empty. This is just the behaviour I am discussing. A quick look at other compilers shows that GCC started to define it at 2.8 and Boland switched to define it as well.My question is, will it change?Over time, I intend to bring it into full conformance with C++ 98. I don't know at the moment if that means yes or no to your question <g>.Got it. That fixes it so that my examples run. Thanks JohnAlso, the latest version of DM 8.1f does break some STL code with map andsetwhich previously worked.Try #defining the ARROW workaround in stl_config.h.
Oct 11 2001
John Fletcher wrote in message <3BC5813B.ED894AC0 aston.ac.uk>...Got it. That fixes it so that my examples run.What kind of examples do you have? Are they in a form that can be incorporated into my test suite (!) and are also freely redistributable so I can legally do it? One of my problems implementing STL is a lack of self-contained test code.
Oct 11 2001
In the SGI-STL.tar.gz is a directory SC with about 18 test programs... I do not know if you got those already?! Jan Walter wrote:John Fletcher wrote in message <3BC5813B.ED894AC0 aston.ac.uk>...Got it. That fixes it so that my examples run.What kind of examples do you have? Are they in a form that can be incorporated into my test suite (!) and are also freely redistributable so I can legally do it? One of my problems implementing STL is a lack of self-contained test code.
Oct 11 2001