函数体中没有使用c++成员函数参数,这是什么情况?

标签 c++ c++11

我看到这段代码,它是一个类成员函数定义。但是参数只是 std::tuple<> 并且没有在函数体中使用。这是什么意思? (来自 dlib.net dlib/dnn/core.h)

    add_layer (         
        std::tuple<> 
    ) : add_layer() {}

最佳答案

the argument is just std::tuple<> and it is not being used in the function body.


没有什么 std::tuple<>可用于函数体中。这是一个空类。

What does this mean?


它是一个构造函数。它委托(delegate)给默认构造函数。

关于函数体中没有使用c++成员函数参数,这是什么情况?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64218789/

相关文章:

c++ - 如何使用 Box2D 在 cocos2d iPhone 上调整 b2CircleShape 的大小

c++ - 删除具有 protected 析构函数的对象

c++ - std::array 模板实例会占用更多代码内存吗?

c++ - 如何正确使用 unordered_map C++

c++ - 使用 C++ 的 OpenGL : vtable troubles when passing class array to glTexImage2d

c++ - 删除 DirectShow 过滤器(未调用析构函数)

c++ - 我的矩阵乘法与 BLAS 的精度不一样

c++ - UDP 加密 - 简单且安全

c++ - 决定在 random_device 和 seed_seq 之间生成多个随机数序列的种子

c++ - Linux 上的 Visual Studio 2012 编译器替代品?