我在GoingNative2012中看到的运算符" "是什么
What is operator"" that I saw in GoingNative2012
我最近看了GoingNative2012,当然是关于C++11。
在Bjarne Stroustrup部分,我发现有一个有趣的运算符函数,如下所示。
constexpr Value<Second> operator""s(long double d)
{
return Value<Second>(d);
}
好吧,除了看起来像 C++11 中的新关键字的 constexpr 之外,
我从来不知道"是可重载的?
尽管我未能使用 VS 2010 进行测试,但这是否是 C++ 中的新功能之一?
提前谢谢。
这是一个
新的 C++11 核心语言功能:用户定义的 litterals
相关文章:
- 重载运算符的范围是什么?它是否会影响作为类成员的集合的插入函数?
- "operator()"在重载运算符方法中是什么意思,在priority_queue(STL)中用作C++中的比较器?
- 是什么让一些命名函数/运算符与众不同?
- C++,()运算符重载,它的工作是什么
- std::set<Key,Compare,Allocator>::find() 函数使用"<"运算符而不是"=="运算符背后的直觉是什么?
- 使输出流式处理运算符适用于 boost::variant<std::vector<int>、int、double 的正确方法是什么>
- c++运算符重载-我实际返回的操作数类型是什么
- 这个typedef和转换运算符语法是什么意思
- _bstr_t::运算符=是什么意思?
- C++中的<<运算符是什么?
- "飞机"不提供下标运算符是什么意思"
- 开关语句中的逗号运算符是什么意思
- 类名中使用的范围解析运算符是什么意思
- 这个C++运算符是什么意思
- 我在GoingNative2012中看到的运算符" "是什么
- @ 运算符是什么?
- & 运算符是什么意思?
- ==<>运算符是什么意思?
- C++中的 <?= 运算符是什么
- C++ - 在 std::cin.getline() 中使用 'dot' 运算符是什么意思?