Gesendet: Mittwoch, 01. Februar 2017 um 17:04 Uhr
Von: "Peter Dimov"
An: boost@lists.boost.org
Betreff: Re: [boost] [factory][bind] C2664 with MSVC 2015 & 1.63
Jens Weller wrote:
Hello Boost,
I'm having this Problem:
http://lists.boost.org/boost-users/2015/04/84176.php
That message already describes pretty much what I see, except that I use
1.63 and the latest 2015 VC++.
Can you please give me a short but complete program that fails with the same
or a similar error?
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Hi Peter,
yes, I managed to that by now:
#include
#include
#include
struct Widget {};
struct Panel: Widget{Panel(Widget* q){}};
using make_interface = boost::function;
void registerType(const make_interface &make)
{
//factory.register_factory(type_id,make);
}
int main(int argc, char *argv[])
{
auto f = boost::factory();
registerType( boost::bind(f,_1));//< this line is the cause, factory it self compiles
}
Error: boost\bind\bind.hpp:249: error: C2664: 'Panel *boost::factory::operator ()(void) const': cannot convert argument 1 from 'Widget *' to 'Widget *&'
thanks,
Jens Weller
Adding the full error message from compiler output here:
D:\cpp\libraries\boost_1_63_0\boost/bind/bind.hpp(249): error C2664: 'Panel *boost::factory::operator ()(void) const': cannot convert argument 1 from 'Widget *' to 'Widget *&'
D:\cpp\libraries\boost_1_63_0\boost/bind/bind.hpp(1306): note: see reference to function template instantiation 'R *boost::_bi::list1>::operator ()(boost::_bi::type,F &,A &,long)' being compiled
with
[
R=Panel *,
F=boost::factory,
A1=Widget *,
A=boost::_bi::rrlist1
]
D:\cpp\libraries\boost_1_63_0\boost/bind/bind.hpp(1306): note: see reference to function template instantiation 'R *boost::_bi::list1>::operator ()(boost::_bi::type,F &,A &,long)' being compiled
with
[
R=Panel *,
F=boost::factory,
A1=Widget *,
A=boost::_bi::rrlist1
]
D:\cpp\libraries\boost_1_63_0\boost/function/function_template.hpp(138): note: see reference to function template instantiation 'Panel *boost::_bi::bind_t,boost::_bi::list1>>::operator ()<T>(A1 &&)' being compiled
with
[
T=Widget *,
A1=Widget *
]
D:\cpp\libraries\boost_1_63_0\boost/function/function_template.hpp(138): note: see reference to function template instantiation 'Panel *boost::_bi::bind_t,boost::_bi::list1>>::operator ()<T>(A1 &&)' being compiled
with
[
T=Widget *,
A1=Widget *
]
D:\cpp\libraries\boost_1_63_0\boost/function/function_template.hpp(132): note: while compiling class template member function 'Widget *boost::detail::function::function_obj_invoker1::invoke(boost::detail::function::function_buffer &,T0)'
with
[
FunctionObj=boost::_bi::bind_t,boost::_bi::list1>>,
R=Widget *,
T0=Widget *
]
D:\cpp\libraries\boost_1_63_0\boost/function/function_template.hpp(936): note: see reference to function template instantiation 'Widget *boost::detail::function::function_obj_invoker1::invoke(boost::detail::function::function_buffer &,T0)' being compiled
with
[
FunctionObj=boost::_bi::bind_t,boost::_bi::list1>>,
R=Widget *,
T0=Widget *
]
D:\cpp\libraries\boost_1_63_0\boost/function/function_template.hpp(936): note: see reference to class template instantiation 'boost::detail::function::function_obj_invoker1' being compiled
with
[
FunctionObj=boost::_bi::bind_t,boost::_bi::list1>>,
R=Widget *,
T0=Widget *
]
D:\cpp\libraries\boost_1_63_0\boost/function/function_template.hpp(727): note: see reference to function template instantiation 'void boost::function1::assign_to<Functor>(Functor)' being compiled
with
[
R=Widget *,
T0=Widget *,
Functor=boost::_bi::bind_t,boost::_bi::list1>>
]
D:\cpp\libraries\boost_1_63_0\boost/function/function_template.hpp(727): note: see reference to function template instantiation 'void boost::function1::assign_to<Functor>(Functor)' being compiled
with
[
R=Widget *,
T0=Widget *,
Functor=boost::_bi::bind_t,boost::_bi::list1>>
]
D:\cpp\libraries\boost_1_63_0\boost/function/function_template.hpp(1073): note: see reference to function template instantiation 'boost::function1::function1<Functor>(Functor,int)' being compiled
with
[
R=Widget *,
T0=Widget *,
Functor=boost::_bi::bind_t,boost::_bi::list1>>
]
D:\cpp\libraries\boost_1_63_0\boost/function/function_template.hpp(1072): note: see reference to function template instantiation 'boost::function1::function1<Functor>(Functor,int)' being compiled
with
[
R=Widget *,
T0=Widget *,
Functor=boost::_bi::bind_t,boost::_bi::list1>>
]
..\msvctestbed\main.cpp(19): note: see reference to function template instantiation 'boost::function::function,boost::_bi::list1>>>(Functor,int)' being compiled
with
[
Functor=boost::_bi::bind_t,boost::_bi::list1>>
]
..\msvctestbed\main.cpp(19): note: see reference to function template instantiation 'boost::function::function,boost::_bi::list1>>>(Functor,int)' being compiled
with
[
Functor=boost::_bi::bind_t,boost::_bi::list1>>
]