Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is operator"" that I saw in GoingNative2012

I recently watched GoingNative2012 about, of course, C++11.

In Bjarne Stroustrup section, I found out there was an interesting operator function, which was as belows.

constexpr Value<Second> operator""s(long double d)
{
     return Value<Second>(d);
}

Well, beside constexpr that looks like a new keyword in C++11,

I've never known "" is overload-able?

Is this one of the new features in C++ although I failed to test it using VS 2010?

Thanks in advance.

like image 312
Dean Seo Avatar asked Apr 07 '12 09:04

Dean Seo


1 Answers

It is a new C++11 core language feature: user defined litterals

like image 61
Basile Starynkevitch Avatar answered Oct 19 '22 22:10

Basile Starynkevitch