This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++-0x] User-defined literals.


On 10/04/2010 02:16 PM, 3dw4rd@verizon.net wrote:
You shouldn't be able to call it as just _foo(1.2L); an operator name is
different from a normal function name.

According to 13.5.8/7 :


   [ Note: literal operators and literal operator templates are usually invoked implicitly through user-deïned
   literals (2.14.8). 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 tem-
   plates 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 ]

Yes, they are ordinary functions/function templates; ordinary functions with names like operator""x, which is different from plain x.


   17.6.3.3.5   User-deïned literal suïxes                                                      [usrlit.suïx]
   Literal suïx identiïers that do not start with an underscore are reserved for future standardization.

Ah, thanks.


Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]