This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: testing techniques for verifying includes in std:: namespace
- The "archetypes" part, which tests that an algorithm does not try
to use any operations on its input types that aren't stated in the
concept requirements. For example, this would detect a "for (; first <
last; ++first)" error in an algorithm that is meant to take input
iterators. This kind of checking is unnecessary in ConceptGCC, because
the compiler itself will diagnose the error when the template is parsed.
- The "concept checks" part, which tests that the user has provided
types that meet the minimum stated requirements of the algorithm. For
example, this would detect an attempt to use adjacent_find on an input
iterator. This kind of checking is unnecessary in ConceptGCC, because
the compiler checks that the user-provided types meet the stated
requirements of the algorithm before the algorithm is instantiated.
Thanks for the clarification.
I was thinking that eventually, there would be negative tests to verify
these two parts.
No?
- The other "concept checks" part, which tests that the data
structures provided by a library meet the requirements of its concepts.
For example, this would check that vector<int> is actually a model of
the Sequence concept. This kind of checking is unnecessary in
ConceptGCC, because the library contains "concept maps" stating that
vector<T> is a model of Sequence, and the compiler checks the
correctness of concept maps when they are defined.
Unless there are other concept-related checks that I'm not thinking of,
concept checking doesn't really have a place in a concept-enabled
library. We've provided language features that do all of that checking
for us, automatically, without the need for the techniques used in
today's concept checkers. In ConceptGCC, I've just stripped out all of
the existing concept-checking code.
Ooops. Yes, I noticed that you stripped out all the old-style concept
checking code, which is a good thing IMHO as concept gcc has better
techniques for this.
best,
benjamin