Boost logo

Boost Users :

Subject: [Boost-users] boost::mpl::for_each: ambiguous call to overloaded function
From: peter_foelsche_at_[hidden]
Date: 2008-10-03 18:09:28


I don't understand why the compiler thinks there is am ambiguity. I pass only two template arguments and expected the compiler to select the matching for_each with two template arguments.

        inline CThis &operator=(const double _d)
        { m_dValue = _d;
                boost::mpl::for_each<CDB, CSet0>(CSet0(*this));
                return *this;
        }

c:\documentsandsettings\pfoelsch\mydocuments\hisim_hv\win32\gglib\mosfet_bsim3v324\../../classlib/CDer.h(291) : error C2668: 'boost::mpl::for_each' : ambiguous call to overloaded function
        C:\boost_1_35_0\boost/mpl/for_each.hpp(105): could be 'void boost::mpl::for_each<CDB,CDer<CDB>::CSet0>(F,Sequence *)'
        with
        [
            CDB=boost::mpl::vector<boost::mpl::false_,boost::mpl::true_,boost::mpl::true_>,
            F=CDer<boost::mpl::vector<boost::mpl::false_,boost::mpl::true_,boost::mpl::true_>>::CSet0,
            Sequence=boost::mpl::vector<boost::mpl::false_,boost::mpl::true_,boost::mpl::true_>
        ]
        C:\boost_1_35_0\boost/mpl/for_each.hpp(91): or 'void boost::mpl::for_each<CDB,CDer<CDB>::CSet0,CDer<CDB>::CSet0>(F,Sequence *,TransformOp *)'
        with
        [
            CDB=boost::mpl::vector<boost::mpl::false_,boost::mpl::true_,boost::mpl::true_>,
            F=CDer<boost::mpl::vector<boost::mpl::false_,boost::mpl::true_,boost::mpl::true_>>::CSet0,
            Sequence=boost::mpl::vector<boost::mpl::false_,boost::mpl::true_,boost::mpl::true_>,
            TransformOp=CDer<boost::mpl::vector<boost::mpl::false_,boost::mpl::true_,boost::mpl::true_>>::CSet0
        ]
        while trying to match the argument list '(CDer<CDB>::CSet0, boost::mpl::vector<T0,T1,T2> *)'
        with
        [
            CDB=boost::mpl::vector<boost::mpl::false_,boost::mpl::true_,boost::mpl::true_>
        ]
        and
        [
            T0=boost::mpl::false_,
            T1=boost::mpl::true_,
            T2=boost::mpl::true_
        ]
        c:\documentsandsettings\pfoelsch\mydocuments\hisim_hv\win32\gglib\mosfet_bsim3v324\../../classlib/CDer.h(290) : while compiling class template member function 'CDer<CDB> &CDer<CDB>::operator =(const double)'
        with
        [
            CDB=boost::mpl::vector<boost::mpl::false_,boost::mpl::true_,boost::mpl::true_>
        ]
        c:\documentsandsettings\pfoelsch\mydocuments\hisim_hv\win32\gglib\mosfet_bsim3v324\bsim3_include.h(16) : see reference to class template instantiation 'CDer<CDB>' being compiled
        with
        [
            CDB=boost::mpl::vector<boost::mpl::false_,boost::mpl::true_,boost::mpl::true_>
        ]


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net