How do you implement the factorial function in C++ with proper error handling?
<p>I asked this before but it was closed by people who didn't understand the question. I'm not looking for just a loop, I am looking for how you would do it for production code with stuff like error handling for arguments and overflows.</p>

<p>And please don't just say "use library X" unless you can link to the code for said library and it actually addresses these concerns.</p>
