The love of birds begins with the heart.
esv::fact calculates the factorial result of value.
constexpr auto result = esv::fact(unsigned_value);
constexpr auto result = esv::fact.fn<return_type>(unsigned_value);
constexpr auto result = esv::fact.fn<return_type, unsignned_arg_type>(value);
esv::fact(???) :
esv::fact.fn<return_type>(???) :
esv::fact.fn<return_type, unsigned_arg_type>(???) :
#include <esvcpp/math.hpp>
#include <esvcpp/core.hpp> #include <esvcpp/math.hpp> int main() { // arg_type is esv::u32 constexpr auto result1 = esv::fact(8u); // arg_type is esv::u32, result is converted to esv::f32 constexpr auto result1 = esv::fact<esv::f32>(8u); // arg_type is esv::ux32, result is converted to esv::ix32 constexpr auto result2 = esv::fact<esv::ix32, esv::ux32>(8); esv::print(result1, result2, result3); }