A
Alex Buell
I think one of the program snippets in the Boost's Bind library is
wrong. I've just been trying to find the error in this program as
below, perhaps there's an typo in there somewhere but I can't find it.
Perhaps one of you lot might know what the typo is:
#include <iostream>
#include <string>
#include <boost/bind.hpp>
class tracer
{
public:
tracer()
{
std::cout << "tracer::tracer()\n";
}
tracer(const tracer& other)
{
std::cout << "tracer::tracer(const tracer& other)\n";
}
tracer& operator=(const tracer& other)
{
std::cout << "tracer& tracer:perator=(const tracer&
other)\n"; return *this;
}
~tracer()
{
std::cout << "tracer::~tracer()\n";
}
void print(const std::string& s) const
{
std::cout << s << '\n';
}
};
int main()
{
tracer t;
boost::bind(&tracer:rint, t, _1)(std::string("I'm called on a
copy of t\n")); return 0;
}
wrong. I've just been trying to find the error in this program as
below, perhaps there's an typo in there somewhere but I can't find it.
Perhaps one of you lot might know what the typo is:
#include <iostream>
#include <string>
#include <boost/bind.hpp>
class tracer
{
public:
tracer()
{
std::cout << "tracer::tracer()\n";
}
tracer(const tracer& other)
{
std::cout << "tracer::tracer(const tracer& other)\n";
}
tracer& operator=(const tracer& other)
{
std::cout << "tracer& tracer:perator=(const tracer&
other)\n"; return *this;
}
~tracer()
{
std::cout << "tracer::~tracer()\n";
}
void print(const std::string& s) const
{
std::cout << s << '\n';
}
};
int main()
{
tracer t;
boost::bind(&tracer:rint, t, _1)(std::string("I'm called on a
copy of t\n")); return 0;
}