OverviewThe C++11 standard has added a new operator that can be overloaded. Literals in programming languages are hard-coded constants in programs. For example, writing
4096, etc. are all literals (i.e., the first is a
long doublevalue, the second is a
const charvalue, and the third is an
int). The C++11 standard allows one to define custom literal types that can be transformed at compile-time or run-time into appropriate values. This post explores such using g++ v4.7 snapshot 20111029.
Полностью читать здесь: http://preney.ca/paul/2011/11/01/using-the-cpp-literal-operator/