I just implemented (once again) a recursive template for computing the factorial of an integer at compile time (who would had thought that some day I'll actually need it!). Still, instead of rolling my own, I went to Boost looking for an answer. However, the factorial function in special math specifically forbids its use with integer types, so I just wrote my own.
Still, is there another function in Boost that I should use? Should I cast my integer to double
and use the boost::factorial
function? Is the computation performed at compile time?