On 01/17/11 14:18, Paul wrote:
la> [snip]
Could you post a test driver showing the problem. I'd like to see how:
In rough (but working) code:
With the program in 1st attachment, when compiled with gcc4.5.1 with the -ftime-report option, I get the timing results shown in 2nd attachment. Plotting the results using: http://soft.proindependent.com/qtiplot.html showed quadratic looking curves with boost::variant the clear winner. Also with qtiplot, the curves were fitted (pretty closely from looking at the fitted quadratics). The log output from the fitting is shown in 3ird attachment which shows the polynomial coefficients. So, based on these fitting results, you might find the boost::variant visitors faster than the CLoPtrVariant visitors. I've no idea why a specialized visitor, like CLoPtrVariant, would be slower than the more general one, like boost:;variant. Indeed, the most general visitor, OneOfMaybe, is the slowest, so there's no obvious general rule :( HTH. -Larry