I use boost a lot in my code but have so far refrained from using std::tr1
. Now I need a more sophisticated function pointer, like those two can provide. Unfortunately C+11 is not an option yet. I read that boost::function
can be tricky with certain compilers e.g. (Visual Studio before 7.1 needs a special portable syntax) but have not found any information on std::tr1::function
regarding this subject. Are there any important differences concerning memory usage, speed and compatibility between the two ?
Edit: I am currently using gcc 4.7 but the code should also compile on Visual Studio and preferably also slightly more dated versions like 2005