Boost logo

Boost :

From: Dave Abrahams (dave_at_[hidden])
Date: 2003-02-06 22:26:14


At TCS3, I met Leor Zolman, the author of STLFilt, the C++ error message
"decryptor." He asked what it would take for me to start using STLFilt, and
I told him I didn't care about most of what he was doing -- compressing STL
iterator types down to sensible typedefs, and removing information that most
people find useless but I find essential. We started to talk about what I
*do* need: a useful re-ordering for GCC error messages, so I don't have to
wade through an instantiation backtrace just to see what went wrong, and
some nice wrapping for long template types. I'm pleased to say that Leor did
an amazing job. It's GCC-only for the time being; here's a sample of some
of the output, wrapped a bit more-narrowly than you'd probably want, so that
it won't be mangled by mailers:

c:/boost/boost/function/function_template.hpp:98: `a0' has incomplete
    type
c:/boost/boost/function/function_template.hpp: In static member
    function
   `static boost::detail::function::unusable boost::detail::function
    ::void_function_invoker4<
        void (*)(int*, int, int&, float&), void, int[], int, int&
      , float
>::invoke(
        boost::detail::function::any_pointer, int[], int, int&, float
    )':
c:/boost/libs/function/test/sum_avg_portable.cpp:21: instantiated
    from here
c:/boost/boost/function/function_template.hpp:448: instantiated
    from
   `void boost::function4<
        void, int[], int, int&, float
>::assign_to(
        void (*)(int*, int, int&, float&)
      , boost::detail::function::function_ptr_tag
    )'
c:/boost/boost/function/function_template.hpp:432: instantiated
    from
   `void boost::function4<
        void, int[], int, int&, float
>::assign_to(void (*)(int*, int, int&, float&))'
c:/boost/boost/function/function_template.hpp:293: instantiated
    from `boost::function4<
        void, int[], int, int&, float
>::function4(
        void (*)(int*, int, int&, float&)
      , boost::detail::function::enable_if<
            boost::type_traits::ice_not<
                boost::is_same<void (*)(int*, int, int&, float&),
                    int
>::value
>::value, int
>::type
    )'
c:/boost/boost/function/function_template.hpp:346: instantiated
    from
   `boost::detail::function::enable_if<
        boost::type_traits::ice_not<
            boost::is_same<void (*)(int*, int, int&, float&), int>::
            value
>::value
      , boost::function4<void, int[], int, int&, float>&
>::type boost::function4<void, int[], int, int&, float>::
    operator=(void (*)(int*, int, int&, float&))'
c:/boost/libs/function/test/sum_avg_portable.cpp:21: instantiated
    from here

For reference, you can compare this with:

http://boost.sourceforge.net/regression-logs/cs-linux-links.html#sum_avg_portable%20gcc

If this looks useful to you, get Leor's Beta from
http://www.bdsoft.com/tools/stlfilt.html. Look for the phrase "template
metaprogramming". BTW, there are lots of options; if you don't like leading
commas, for example, you can turn them off.

--
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com

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