A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://timsong-cpp.github.io/cppwp/n4659/over.literal below:

[over.literal]

16 Overloading [over] 16.5 Overloaded operators [over.oper] 16.5.8 User-defined literals [over.literal]
literal-operator-id:
	operator string-literal identifier
	operator user-defined-string-literal

The declaration of a literal operator shall have a parameter-declaration-clause equivalent to one of the following:

const char*
unsigned long long int
long double
char
wchar_t
char16_t
char32_t
const char*, std::size_t
const wchar_t*, std::size_t
const char16_t*, std::size_t
const char32_t*, std::size_t

If a parameter has a default argument, the program is ill-formed.

Literal operators and literal operator templates shall not have C language linkage.

[Note: Literal operators and literal operator templates are usually invoked implicitly through user-defined literals. However, except for the constraints described above, they are ordinary namespace-scope functions and function templates. In particular, they are looked up like ordinary functions and function templates and they follow the same overload resolution rules. Also, they can be declared inline or constexpr, they may have internal or external linkage, they can be called explicitly, their addresses can be taken, etc. end note]

[Example:

void operator "" _km(long double);                  string operator "" _i18n(const char*, std::size_t); template <char...> double operator "" _\u03C0();    float operator ""_e(const char*);                   float operator ""E(const char*);                    double operator""_Bq(long double);                  double operator"" _Bq(long double);                 float operator " " B(const char*);                  string operator "" 5X(const char*, std::size_t);    double operator "" _miles(double);                  template <char...> int operator "" _j(const char*); extern "C" void operator "" _m(long double);        

end example]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4