Subject: Re: [boost] boost::bind C2664 error with two non-const references
From: Peter Dimov (lists_at_[hidden])
Date: 2015-05-22 07:12:39


Nicolas FRANCOIS wrote:
> #include <boost/bind.hpp>
> #include <boost/function.hpp>
>
> struct A {
> void f(int&, std::vector<int*>&);
> };
>
> int main(){
> A a;
> auto f = boost::bind(&A:f, &a, _1, _2);
> }
>
> results in error C2664: cannot convert from 'const std::vector<int*> &' to
> 'std::vector<int*> &'

This code (after #include <vector> and A:f -> A::f) works for me under
VS2013 and the current develop branch. What compiler are you using?