Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
C++ 如何将连续的区间插入到 std::vector 中?
假设我希望从 23 到 57 的所有数字都在vector 我可以做这个 vector
c
C17
在 C++17 中使用
成员的链接错误
我在 Ubuntu 16 04 上使用 gcc 7 2 并且需要使用 C 17 中的新文件系统库 尽管确实有一个名为experimental filesystem的库 但我无法使用它的任何成员 例如 当我尝试编译此文件时 include
c
gcc
C17
stdfilesystem
为什么大多数平台上没有“aligned_realloc”?
MSVC有自己的非标准函数 aligned malloc aligned realloc and aligned free C 17和C11引入了 std aligned alloc 其结果可以是de分配有free or realloc B
c
memorymanagement
C17
C11
使用透明std函数对象时还需要写空尖括号吗?
通过类模板参数推导 我们可以编写 std less Fn 然而 G 8 2 拒绝此代码 include
c
templates
languagelawyer
C17
templateargumentdeduction
重载逻辑运算符 && 和 ||从 C++17 开始短路?
我读到http en cppreference com w cpp language operators http en cppreference com w cpp language operators 布尔逻辑运算符 运算符 和运算符
c
C17
operatoroverloading
shortcircuiting
枚举器上的 [[maybe_unused]]
查看规格 maybe unused http en cppreference com w cpp language attributes 它指出 出现在类 typedef 变量 非静态数据成员 函数 枚举或枚举器的声明中 如果编译器对未使用
c
attributes
languagelawyer
C17
std::aligned_alloc() 的重新分配等效项是什么?
我发觉到std aligned alloc https en cppreference com w cpp memory c aligned alloc进入 C 17 我喜欢它 但是 当我需要重新分配时会发生什么 我可以手动执行此操作 假设
c
C17
memoryalignment
dynamicallocation
memoryreallocation
检查两个函数或成员函数指针的签名是否相等
我编写了一些代码来检查自由函数的签名是否等于成员函数的签名等 它比较提取的返回类型和函数参数 include
c
variadictemplates
C17
typetraits
functionsignature
std::vector
移动/重新分配内部 wstring.data() 合法吗?
以下是摘录 std vector
c
languagelawyer
C17
为什么C++标准库中没有线程池? [复制]
这个问题在这里已经有答案了 自 C 11 以来 C 中并行 并发编程工具的数量激增 线程 异步函数 并行算法 协程 但是流行的并行编程模式又如何呢 线程池 https en wikipedia org wiki Thread pool 据我
c
Multithreading
C17
ThreadPool
从函数正确传播“decltype(auto)”变量
这是来自 decltype auto 变量有任何实际用例吗 https stackoverflow com questions 57438217 are there any realistic use cases for decltypea
c
C17
AUTO
copyelision
decltypeauto
为什么要为具有重要析构函数的类声明 constrexpr 构造函数(例如 unique_ptr、std::variant)
据我了解 至少对于c 14 析构函数不能是constexpr如果它不是微不足道的 隐式生成或 default 声明的意义何在constexpr具有非平凡析构函数的结构的构造函数 struct X int a constexpr X int
c
c14
constexpr
C17
在gradle c++项目中配置C++标准?
我有一个由以下构建脚本定义的 gradle 项目 build gradle plugins id cpp application application targetMachines add machines linux x86 64 ta
c
Gradle
C17
类型特征的 _t 别名和 _v 变量模板的目的是什么?
有a lot of v and t后缀 例如std is same v std invoke result t result of t以及数百万个其他此类功能 Why它们到底存在吗 在任何情况下公开实施细节 例如std result of
c
C17
c14
languagedesign
typetraits
[现代] C++ 中 N 个变量的范围/循环
遍历 N 个任意类型的变量来执行操作的简洁方法是什么 假设我有变量a b c d e并想要对他们所有人进行一些操作 使用 Boost Hana 和通用 lambda include
c
C11
boost
c14
C17
一个同时接受 std::vector 和 QVector 的函数模板?
假设我有一个函数叫做loadData 它需要一个容器 填充数据 和一个 CSV 文件 我需要以下重载 loadData std vector
c
templates
vector
C17
QVector
类模板的嵌套模板参数推导不起作用
In 本次问答 https stackoverflow com a 42221591 819272我编写了一个小包装类 它提供对范围的反向迭代器访问 依赖于类模板的 c 1z 语言功能模板参数推导 p0091r3 http www open
c
templates
C17
classtemplate
templateargumentdeduction
std::可选 - 使用 {} 或 std::nullopt 构造空?
我认为初始化一个std optional https en cppreference com w cpp utility optional with std nullopt https en cppreference com w cpp u
c
C17
optiontype
std::mutex 和 std::shared_mutex 之间的区别
我遇到了一个std shared mutex in C 17 到底是什么std shared mutex以及它有何不同std mutex 如中所述文档 http en cppreference com w cpp thread shared
c
C11
mutex
C17
参数的值类别在重载解析(或更一般的函数调用处理)的哪一部分中发挥作用?
C 模板 完整指南 http www tmplbook com 在 C 1中 读取 执行重载解析以找到best候选人 如果有则选择 否则 调用是不明确的 然后 在 C 2中 对可能的匹配 给定参数与可行候选的相应参数 进行排序 如下所示 我
c
C17
overloadresolution
valuecategories
«
1
2
3
4
5
6
...22
»