Topic: Userdefined Literal ambiguity


Author: SG <s.gesemann@gmail.com>
Date: Sat, 7 Aug 2010 12:41:17 CST
Raw View
Hi!

Here's the problem:

 0x123DZ  // Is this a potentially valid ud integer literal ?

If so, what operator is the compiler going to look for ?
operator "" DZ or operator "" Z ?
Maybe both ?

I didn't find anything in the current FCD that covers this situation.
But I found N2747 from two years ago which also mentions this
ambiguity. How has this issue been resolved?

User-defined literals are described in section 2.14.8 and 13.5.8 of
the FCD as far as I can tell.

Cheers!
SG

--
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@netlab.cs.rpi.edu]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]





Author: CornedBee <wasti.redl@gmx.net>
Date: Sat, 7 Aug 2010 21:40:27 CST
Raw View
On Aug 7, 11:41 am, SG <s.gesem...@gmail.com> wrote:
> Hi!
>
> Here's the problem:
>
>  0x123DZ  // Is this a potentially valid ud integer literal ?
>
> If so, what operator is the compiler going to look for ?
> operator "" DZ or operator "" Z ?
> Maybe both ?
>
> I didn't find anything in the current FCD that covers this situation.
> But I found N2747 from two years ago which also mentions this
> ambiguity. How has this issue been resolved?
>
> User-defined literals are described in section 2.14.8 and 13.5.8 of
> the FCD as far as I can tell.

Sounds like a simple case of maximum munch rule to me, so the D is
part of the number.

Sebastian


--
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use
mailto:std-c++@netlab.cs.rpi.edu<std-c%2B%2B@netlab.cs.rpi.edu>
]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]