C++11 这行代码有什么作用
C++11 What does this line of code do?
我正在浏览 Nano-signal-slot 源代码,希望它可以帮助我使用 C++11 将信号和时隙功能实现到我的应用程序中,我遇到了一部分我以前从未见过的代码。
部分代码:
/* ... */
template <typename Re_t> class function;
template <typename Re_t, typename... Args>
class function<Re_t(Args...)>
{
void *m_this_ptr;
Re_t(*m_stub_ptr)(void*, Args...);
/* ... */
更具体地说:
class function<Re_t(Args...)>
类名后面做什么?
class function<Re_t(Args...)>
定义了模板化类function<T>
的部分专用化。基本上,这允许您以函子的形式编写专用化,例如:
function<int(double,unsigned)> foo = ...
请注意,由于使用了 Args...
,您可以拥有可变数量的参数。
相关文章:
- archive_read_support_filter_all() 有什么作用?
- 当我们为(;;) 写作时,它做了什么?for 循环中的双分号有什么作用?
- 这个递归函数有什么作用?运行时的复杂性是多少?
- DrawShadow 中的 Elevation 究竟有什么作用?
- 测试"stream >> char"有什么作用?
- "uFlags &= ~CHN_PANNING"命令有什么作用?
- GCC 的 -Wpsabi 选项究竟有什么作用?压制它意味着什么?
- int** a = new int*[n]();这个函数有什么作用?
- C++ 此函数调用之前的(void)有什么作用?
- i+=(i&-i) 有什么作用?它是便携式的吗?
- 这个size_t在 lambda 中有什么作用?C++代码
- 数组下标运算符 ([ ]) 对数组有什么作用?
- 结构之外的节点 * head 有什么作用?
- 重载括号运算符有什么作用?
- clang的"-Ofast"选项在实践中有什么作用,特别是对于与gcc的任何差异?
- std::make_unique_for_overwrite() 对 std::make_unique() 有什么作用?
- 运算符 delete[] 有什么作用?
- 下面的代码有什么作用?c++
- 这个陈述'p = I.ptr<uchar>(i);有什么作用?
- 这个嵌套的名称空间定义有什么作用