Boost logo

Boost :

From: Alexander Nasonov (alnsn-boost_at_[hidden])
Date: 2005-05-30 09:17:31

BOOST_TYPEOF( Z() ), where Z is a class type, gives different results in native
and compliant modes, at least on gcc 3.2.2.

#include <boost/typeof/typeof.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/type_traits/is_same.hpp>


struct Z {};


int main()
    typedef Z(F)(); // function in native mode
    typedef BOOST_TYPEOF( Z() ) fn_or_class;

    // Which line should be commeneted?
    BOOST_MPL_ASSERT(( boost::is_same<fn_or_class,Z> ));
    BOOST_MPL_ASSERT(( boost::is_same<fn_or_class,F> ));

Alexander Nasonov

Boost list run by bdawes at, gregod at, cpdaniel at, john at