Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #41089

Re: "²" - stray '\262' in program

Subject Re: "²" - stray '\262' in program
Newsgroups comp.lang.c++
References <exponentiation-20160221003041@ram.dialup.fu-berlin.de> <nab07i$8ti$1@dont-email.me>
From Vir Campestris <vir.campestris@invalid.invalid>
Date 2016-02-21 20:54 +0000
Message-ID <HOudnRN5GZdmvlfLnZ2dnUU78R2dnZ2d@brightview.co.uk> (permalink)

Show all headers | View raw


On 21/02/2016 00:29, Alf P. Steinbach wrote:
> Or you can do this:
>
>      #include <iostream>
>
>      constexpr auto operator""_²( long double const d )
>          -> long double
>      { return d*d; }
>
>      auto main() -> int { std::cout << 3.00_² << '\n'; }
>
> Except for the non-conforming behavior of g++, of course. <g/>

Alf, I'm obviously not up to date on the standards here. Last time I 
rummaged you could only define operator <something> where <something> 
was one of the standard operators, like +. Could you give me a link 
where I can read about this stuff please?

I seriously thought my newsreader was trying to do something clever, 
like when it turns : ) (without a space) into a smiley.

Andy

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: "²" - stray '\262' in program "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2016-02-21 01:29 +0100
  Re: "²" - stray '\262' in program David Brown <david.brown@hesbynett.no> - 2016-02-21 12:30 +0100
  Re: "²" - stray '\262' in program Vir Campestris <vir.campestris@invalid.invalid> - 2016-02-21 20:54 +0000
    Re: "²" - stray '\262' in program "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2016-02-21 22:15 +0100
      Re: "²" - stray '\262' in program Vir Campestris <vir.campestris@invalid.invalid> - 2016-02-23 21:42 +0000

csiph-web