Using The C++ Literal Operator
Overview
The C++11 standard has added a new operator that can be overloaded. Literals in programming languages are hard-coded constants in programs. For example, writing1.2L
,"Hello World!"
,4096
, etc. are all literals (i.e., the first is along double
value, the second is aconst char[13]
value, and the third is anint
). 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/
Комментариев нет:
Отправить комментарий