пятница, 25 ноября 2011 г.

Про user-defined literals в новом стандарте (C++11)

Using The C++ Literal Operator


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, writing 1.2L, "Hello World!", 4096, etc. are all literals (i.e., the first is a long double value, the second is a const char[13] value, 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/

Комментариев нет:

Отправить комментарий