This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Using incomplete types to instantiate STL-Templates?
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Wolfgang Bangerth <bangerth at ices dot utexas dot edu>
- Cc: gcc at gcc dot gnu dot org, Christian Ehrhardt <ehrhardt at mathematik dot uni-ulm dot de>
- Date: 30 Apr 2003 22:23:39 +0200
- Subject: Re: Using incomplete types to instantiate STL-Templates?
- Organization: Integrable Solutions
- References: <Pine.LNX.4.44.0304301503130.22220-100000@gandalf.ices.utexas.edu>
Wolfgang Bangerth <bangerth@ices.utexas.edu> writes:
| > | I think that's weird, and
| > | personally consider it a defect in the way the concepts checks are
| > | implemented.
| >
| > STL concepts checking in pure C++ is a tough task. I would be pleased to
| > read your implementations :-)
|
| Fair enough. I didn't imply any blame in my wording -- heck, all my job in
| gcc is pointing out errors in some part of gcc or other ;-) If I had to
| fix them all, I'd have a problem...
Well, I see my comments many be read to be rude. I didn't intend that.
What I wanted to convey is that it is as using pure C++ to check STL
concepts is as easy as it might appear at first sight (I believe
Jeremy Siek did many re-designs).
| What I thought is that deferring concepts check to the time we actually
| instantiate an object might be done by placing the check machinery into
| the constructors, since that's the first place we end up in anyway.
I suspect that would be insufficient to ensure that we don't end up with
unprintable self-references (which might send a constructor into
infinite loop). The completness requirement is an attempt to catch
such circumstances. That doesn't mean I would not like to see
struct Person {
std::string name;
std::list<Person> children;
// ...
};
-- Gaby