如何在 c++17 中禁用过于通用的转发构造函数并延迟复制构造函数 [duplicate]
作者:bradgonesurfing 提问时间:3/27/2023
这个问题在这里已经有答案了: 如何使用 sfinae 来选择构造函数?[复制] (5 个答案) 8个月前关闭。 如果我使用 c++20 概念编写简单类 #include <array> #inc...
ST 问答列表
作者:bradgonesurfing 提问时间:3/27/2023
这个问题在这里已经有答案了: 如何使用 sfinae 来选择构造函数?[复制] (5 个答案) 8个月前关闭。 如果我使用 c++20 概念编写简单类 #include <array> #inc...
作者:Mindset 提问时间:4/9/2023
我必须使用复制构造函数和复制赋值运算符来测试链表。 list1 附加了 3 个双精度 list2 = list1,复制构造函数进入其中。 List4 = list3 = list1 是复制赋值运...
作者:FancyPants General 提问时间:5/14/2022
我有 template <class T> class arrList: public linearList<T> { public: arrList() {} arrList(const a...
作者:Enlico 提问时间:6/23/2021
TL的;博士 我想了解下面的第一个代码有什么问题,即错误告诉我什么。 MRE系列 我已经能够将示例缩短为以下内容,这会生成与下面的原始代码相同的错误: #include <boost/hana...
作者:Ashwani Verma 提问时间:3/7/2023
我正在尝试创建一个 typeAhead 表单字段,它可以建议在下面输入的城市名称是小部件 Widget buildCity() { return FutureBuilder<Object>( f...
作者:deceze 提问时间:1/23/2012
有人说“静态方法对可测试性来说是死亡”。如果是这样,那么以下可行的替代模式是什么? class User { private $phone, $status = 'default', $cr...
作者:Narayan Poudel 提问时间:5/12/2022
我已经实现了复制构造函数和移动构造函数,我学到的是程序必须使用 Move 构造函数而不是复制构造函数。 class Move { private: int *data; // raw pointe...
作者:David Carpenter 提问时间:9/3/2022
我在使用 C++ 复制和移动构造函数时遇到了一些奇怪的东西,在这里,当传递给 lambda 表达式时,复制和移动构造函数都会被执行。奇怪的是,当我将 lambda 的声明类型更改为或使用该函数时,我得...
作者:notimportant 提问时间:4/28/2022
linkList::linkList(linkList const& rhs){ Node *temp = rhs.top; Node *temp_stack = rhs.top; while(...
作者:Ders 提问时间:8/22/2023
假设我们有这样的东西: template<typename T> class SparseMatrix { // Where the first (K,V) is (row_idx, column...