Boost logo

Boost :

From: Richard Crossley [Digitimer] (rdc_at_[hidden])
Date: 2002-04-12 08:47:16


The version of ref.hpp currently in cvs fails under VC7 with the
following code:

#include <boost/ref.hpp>

struct X{
        enum E{v};
        void func()
        {
                E e = v;
                boost::ref(e); // line 8
        }
};

c:\boost\boost\utility\addressof.hpp(21) : error C2893: Failed to
specialize function template 'T *boost::addressof(T &)'
        With the following template arguments:
        'X::E'
        c:\boost\boost\ref.hpp(34) : while compiling class-template
member function 'boost::reference_wrapper<T>::reference_wrapper(T &)'
        with
        [
            T=X::E
        ]
        RDCLibTest.cpp(8) : see reference to class template
instantiation 'boost::reference_wrapper<T>' being compiled
        with
        [
            T=X::E
        ]
c:\boost\boost\utility\addressof.hpp(21) : error C2065: 'v' : undeclared
identifier
c:\boost\boost\utility\addressof.hpp(21) : error C2275: 'T' : illegal
use of this type as an expression
        c:\boost\boost\ref.hpp(30) : see declaration of 'T'
c:\boost\boost\ref.hpp(34) : error C2143: syntax error : missing ')'
before '<end Parse>'
c:\boost\boost\ref.hpp(34) : error C2612: trailing '<end Parse>' illegal
in base/member initializer list
c:\boost\boost\ref.hpp(34) : fatal error C1903: unable to recover from
previous error(s); stopping compilation

Regards,

Richard


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