Boost logo

Boost :

From: Daniel Frey (daniel.frey_at_[hidden])
Date: 2001-10-08 04:39:04


Jeremy Siek wrote:
>
> Neat! Have you thought about also prettifying the error messages created
> by the concpet checking library?

I did, but there are some issues I want to solve first. The problem is
to make this run on all compilers (well, at least a reasonable number of
compilers). I'd like to have a header with some macros that allow me to
export almost any message to the booster. The message may look ugly as
long as I can parse it with a regex to cut away all unwanted overhead.

For the concept check library:

Example from the documentation:

boost/concept_check.hpp: In method `void
LessThanComparableConcept<_List_iterator<int,int &,int *>
>::constraints()':
boost/concept_check.hpp:334: instantiated from
`RandomAccessIteratorConcept<_List_iterator<int,int &,int *>
>::constraints()'
bad_error_eg.cpp:6: instantiated from
`stable_sort<_List_iterator<int,int &,int *> >(_List_iterator<int,int
&,int *>, _List_iterator<int,int &,int *>)'
boost/concept_check.hpp:209: no match for `_List_iterator<int,int &,int
*> & < _List_iterator<int,int &,int *> &'

Given the following rules:

"boost/concept_check.hpp: .*?([^< ]*).*" = "BOOST/CONCEPT_CHECK in
method $1\n"
"boost/concept_check.hpp:334:.*instantiated from `([^<]*).*" =
"BOOST/CONCEPT_CHECK instantiated from $1\nBOOST/CONCEPT_CHECK
instantiated from: "
"boost/concept_check.hpp:209: .*" = "BOOST/CONCEPT_CHECK failed!\n"

The output would look like this:

BOOST/CONCEPT_CHECK in method LessThanComparableConcept
BOOST/CONCEPT_CHECK instantiated from RandomAccessIteratorConcept
BOOST/CONCEPT_CHECK instantiated from: bad_error_eg.cpp:6:
instantiated from `stable_sort<_List_iterator<int,int &,int *>
>(_List_iterator<int,int &,int *>, _List_iterator<int,int &,int *>)'
BOOST/CONCEPT_CHECK failed!

(note I both the original and the converted output is 4 lines. This may
not be very readable due to the mail-client, but you can easily
transform it to what your compiler will output).

Of course the rules for the complete concept check library should be
more general to match all cases, not just the small example given. What
I'm thinking about now is '#include' for the rulesets. That way, you'll
have to supply only one main ruleset for your compiler / project and it
will include all rulesets for the libraries... I'll add this feature
this evening.

Regards, Daniel

--
Daniel Frey
aixigo AG - financial training, research and technology
Schloß-Rahe-Straße 15, 52072 Aachen, Germany
fon: +49 (0)241 936737-42, fax: +49 (0)241 936737-99
eMail: daniel.frey_at_[hidden], web: http://www.aixigo.de

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk