[boost::numeric::functional::plus_base] Why the arguments are not const reference
1 Apr
2010
1 Apr
'10
8:23 a.m.
It seems like the operators define in boost::numeric::functional takes reference as argument instead of const reference. Which makes it compile error if I use boost::numeric::functional::plus<int, int> op; int n = op(1,1); The way to work around is boost::numeric::functional::plus<const int, const int> op; int n = op(1,1); This is very ugly and not makes much sense, compared to std::plus. So is it a design flaw or is there some other reason for designing it in this way?
5286
Age (days ago)
5286
Last active (days ago)
0 comments
1 participants
participants (1)
-
Kan Li