Hi,
I've tried to compile the following code on linux/g++ (version 3.3.4
and 4.1.2), boost version 1.34:
-- CODE BEGINS --
#include <iostream>
using namespace std;
#include "boost/function.hpp"
#include "boost/ref.hpp"
using namespace boost;
#include "boost/lambda/lambda.hpp"
#include "boost/lambda/bind.hpp"
#include "boost/lambda/if.hpp"
using namespace boost::lambda;
int main(int argc, char *argv[]) {
function f =
if_(_1 == _2) [
cout << cref("arguments are equal\n")
].else_[
cout << cref("arguments differ\n")
];
f(1, 1);
f(1, 2);
}
-- CODE ENDS --
On g++ 3.3.4 I got a (scarcely readable) error that std::ios_base copy
constructor is private (the more recent compiler gave much more trashy
output, but I've infered that the reason is probably the same).
The error wouldn't appear if I had supplied at least one placeholder
to the operator<< in both if's cases in the lambda expression above.
Is there any way to overcome this limitation?