[boost] Passing value safely to functions