This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52521] [C++11] user defined literals and order of declaration
- From: "marc.glisse at normalesup dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 16 Mar 2012 19:39:14 +0000
- Subject: [Bug c++/52521] [C++11] user defined literals and order of declaration
- Auto-submitted: auto-generated
- References: <bug-52521-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52521
--- Comment #7 from Marc Glisse <marc.glisse at normalesup dot org> 2012-03-16 19:39:14 UTC ---
(In reply to comment #6)
> constexpr long double operator"" _degrees(long double d)
> {
> return d * 0.0175;
> }
>
> int main()
> {
> long double pi = 180_degrees;
> std::cout << pi << std::endl;
> }
There is no dot in 180, so it is looking for an unsigned long long overload
(which you could provide). 180._degrees works.