Hi. So I decided to write a simple little math header for my personal use. You know, useful little things like line intersections, etc.
1 2 3 4 5 6
class line
{
float; pa[2], pb[2];
float slope;
float yipt;
};
But how can I do something where the function user doesn't neccessarily have all of the numerical values at hand? In a way, maybe "setValues(this=this, that=that, rest-left-unentered)"
#include <boost/bind.hpp>
#include <boost/function.hpp>
#include <iostream>
int add_three( int a, int b, int c ) {
return a + b + c;
}
int main() {
boost::function<int(int,int)> add_two( boost::bind( &add_three, 42, _1, _2 ) );
std::cout << add_two( 21, 10 ) << std::endl;
}