Topic: STL fragmentation
Author: Gerard Weatherby <gerardw@alum.mit.edu>
Date: 1997/04/21 Raw View
Dan Muller wrote:
> Are there any thoughts in the Committee that the STL should have
> some of its objects broken into smaller pieces so that both
> lightweight and heavyweight versions could be instantiated?
> (E.g., have heavyweight versions derive from lightweight versions.)
Why would this be necessary? Since all of the STL objects are templates,
only those member functions which are actually used by a given
instantiation should be instantiated. In what sense do you consider the
STL class templates to heavyweight?
----
Herb Sutter wrote:
pedwards@cs.wright.edu (Phil Edwards) wrote:
>[1] Since the complete functionality is in the header files, it /all/ gets
>compiled.
Actually, this is no longer required for templates.
>No "you didn't actually use it so you don't need to link it"
>getaways here.
Actually, this is specifically required for templates.
--------
I was suprised at the comments regarding which functions get compiled,
because I know the compilers I've worked with compile ALL functions.
Reviewing the draft, it's clear Dan and Herb are right: they're not
supposed to. This is another case where compilers haven't caught up
with the draft.
---
[ comp.std.c++ is moderated. To submit articles: Try just posting with your
newsreader. If that fails, use mailto:std-c++@ncar.ucar.edu
comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
Comments? mailto:std-c++-request@ncar.ucar.edu
]
Author: James Kanze <james-albert.kanze@vx.cit.alcatel.fr>
Date: 1997/04/23 Raw View
herbs@cntc.com (Herb Sutter) writes:
|> pedwards@cs.wright.edu (Phil Edwards) wrote:
|> >[1] Since the complete functionality is in the header files, it /all/ gets
|> >compiled.
|>
|> Actually, this is no longer required for templates.
Yes and no. It was never required (according to the ARM, and most
compilers). In the latest draft, however, it IS required unless the
templates are specified "export". Since I know of no compiler to date
which supports "export", it is required for templates which are written
today.
--
James Kanze home: kanze@gabi-soft.fr +33 (0)1 39 55 85 62
office: kanze@vx.cit.alcatel.fr +33 (0)1 69 63 14 54
GABI Software, Sarl., 22 rue Jacques-Lemercier, F-78000 Versailles France
-- Conseils en informatique industrielle --
---
[ 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 ]
[ FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html ]
[ Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu ]
Author: Eric Gindrup <gindrup@okway.okstate.edu>
Date: 1997/04/18 Raw View
Are there any thoughts in the Committee that the STL should have
some of its objects broken into smaller pieces so that both
lightweight and heavyweight versions could be instantiated?
(E.g., have heavyweight versions derive from lightweight versions.)
-- Eric Gindrup ! gindrup@okway.okstate.edu
---
[ comp.std.c++ is moderated. To submit articles: Try just posting with your
newsreader. If that fails, use mailto:std-c++@ncar.ucar.edu
comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
Comments? mailto:std-c++-request@ncar.ucar.edu
]
Author: danm@ziplink.net (Dan Muller)
Date: 1997/04/19 Raw View
In article <33580BC3.6658@okway.okstate.edu>, gindrup@okway.okstate.edu
says...
> Are there any thoughts in the Committee that the STL should have
> some of its objects broken into smaller pieces so that both
> lightweight and heavyweight versions could be instantiated?
> (E.g., have heavyweight versions derive from lightweight versions.)
Why would this be necessary? Since all of the STL objects are templates,
only those member functions which are actually used by a given
instantiation should be instantiated. In what sense do you consider the
STL class templates to heavyweight?
--
Dan Muller danm@ziplink.net
http://www.ziplink.net/~danm
---
[ 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 ]
[ FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html ]
[ Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu ]
Author: herbs@cntc.com (Herb Sutter)
Date: 1997/04/20 Raw View
pedwards@cs.wright.edu (Phil Edwards) wrote:
>[1] Since the complete functionality is in the header files, it /all/ gets
>compiled.
Actually, this is no longer required for templates.
>No "you didn't actually use it so you don't need to link it"
>getaways here.
Actually, this is specifically required for templates.
---
Herb Sutter (mailto:herbs@cntc.com)
Current Network Technologies Corp. (http://www.cntc.com)
2695 North Sheridan Way, Suite 150, Mississauga ON Canada L5K 2N6
Tel 416-805-9088 Fax 905-822-3824
---
[ comp.std.c++ is moderated. To submit articles: Try just posting with your
newsreader. If that fails, use mailto:std-c++@ncar.ucar.edu
comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
Comments? mailto:std-c++-request@ncar.ucar.edu
]
Author: danm@ziplink.net (Dan Muller)
Date: 1997/04/21 Raw View
In article <5jbpjf$n8b$1@alpha.wright.edu>, pedwards@cs.wright.edu
says...
> [1] Since the complete functionality is in the header files, it /all/ gets
> compiled. No "you didn't actually use it so you don't need to link it"
> getaways here.
Phil, this is not correct. Any class template member functions or
function templates that are not used should not be instantiated, let
alone linked. At least according to the draft standard -- current
compiler technology is another question altogether.
--
Dan Muller danm@ziplink.net
http://www.ziplink.net/~danm
---
[ 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 ]
[ FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html ]
[ Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu ]