$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-users] [Bind] Placeholders passed by reference?
From: Robert Jones (robertgbjones_at_[hidden])
Date: 2010-07-06 04:51:37
This works exactly as expected...
void f( unsigned & val ) { val *= 2; }
unsigned i = 3;
boost::bind( f, _1)( i );
with i being doubled. What I don't get is why I don't need to
say
boost::bind( f, boost::ref( _1 ) )( i );
and conversely how I specify that I want bind to pass by value
rather than by reference for the placeholder.
Thanks
- Rob.