Q:

C++ Casting a string to an unsigned long long

In C++ two options I've found for casting a string to an unsigned long long are:
boost::lexical_cast<unsigned long long>(theString);  //option#1
stoull(theString);                                   //option#2

What are the differences?
Is one preferred?  If yes, why?
Are there other options that are better?  If yes, why is the option better?

A:

std::stoull receives the vigorous review that the standard library gets.  Prefer it.
You would need to use boost::lexical_cast if:

You are using a C++ standard before C++11.
You are converting to a templated type that may be unsigned long long, but may be another type.

