Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
为什么他们会对某些初始值设定项列表进行特殊处理,而不是将它们全部视为相同?
假设我有一个变量auto x我想初始化为7使用大括号初始化 简单 auto x 7 除了我了解到 x 是NOT一个整数 但它本身是一个初始化列表 为什么 委员会决定是否有具体原因auto应该在单个自动值的情况下获取初始化列表 或者他们是否希
c
C11
AUTO
listinitialization
C++ 错误:没有调用“print_size”的匹配函数
我有这个代码 include
c
C11
initializerlist
AUTO
类似于 std::integral_constant 但在 std C++20 库中具有自动模板参数?
从C 20开始可以使用auto实现积分常量的模板参数 在线尝试一下 https godbolt org z 3dfq7bbP1 template
c
C20
AUTO
compiletimeconstant
为什么我可以在私有类型上使用 auto?
我对以下代码的编译和运行感到惊讶 vc2012 gcc4 7 2 class Foo struct Bar int i public Bar Baz return Bar int main Foo f Foo Bar b f Baz err
c
C11
AUTO
privatemembers
为什么数组的类型推导优先考虑指向第一个的指针而不是对数组的引用?
int v 1 auto p1 v auto p2 v auto p3 v p1属于类型int 同样适用于p3 特别是在这个微不足道的样本中 我发现p2 int 1 更有用 因为它固有的数组语义 例如我可以申请sizeof on p2给予与
c
templates
C11
AUTO
typededuction
如何从自动返回类型推导出类型? [复制]
这个问题在这里已经有答案了 这个答案 https stackoverflow com a 11774533 476681有这样的代码片段 template
c
C11
AUTO
decltype
returntypededuction
为什么 auto 在 C++ 中的 2D 和 1D 数组的“range for”中工作方式不同
您好 我正在 C 中处理 2D 和 1D 数组并使用范围为访问元素 我使用的代码如下 对于二维数组 int ia 3 4 1 2 3 4 5 6 7 8 9 for auto row ia for auto col row cout lt
c
Arrays
forloop
pointers
AUTO
带有auto的initializer_list包含多个表达式
相当简单的问题 auto x11 1 2 3 4 auto x1 1 2 3 4 auto x22 1 0 2 25 3 5 auto x2 1 0 2 25 3 5 据我了解 这里应该没有什么区别 或不 但是 使用 llvm clang
c
languagelawyer
C17
AUTO
为什么这个具有推导返回类型的内联方法尚未定义?
include
c
C11
AUTO
在 C++14 中推导“auto”之前使用“auto func(int)”
我使用 GCC 编译了以下程序C 14 include
c
function
gcc
c14
AUTO
decltype(auto) 和 decltype(returning expr) 作为返回类型有什么区别?
有什么区别decltype auto and decltype returning expression 作为函数 模板 的返回类型如果expr在这两种情况下都没有使用括号吗 auto f gt decltype auto return e
c
c14
AUTO
decltype
使用 constexpr auto/char-array 变量观察到的不同行为
跟进这个问题拥有 constexpr 静态字符串会导致链接器错误 https stackoverflow com questions 34792403 having a constexpr static string gives a lin
c
C11
languagelawyer
constexpr
AUTO
为什么 lambda 函数默认删除推导的返回类型引用?
在 C 14 中 为什么具有推导返回类型的 lambda 函数默认会删除返回类型中的引用 IIUC 因为具有推导返回类型 没有显式尾随返回类型 的 C 14 lambda 函数的返回类型为auto 它会删除引用 除其他外 为什么做出这个决定
c
Lambda
Clang
c14
AUTO
如果使用返回引用的函数初始化“auto”var,为什么它不声明引用类型?
当使用返回引用的函数初始化 auto var 时 为什么 var 类型不是引用 例如在下面的示例中 为什么 x 的类型是 Foo 而不是 Foo class TestClass public Foo GetFoo return mFoo p
c
C11
AUTO
为什么auto a=1;用C编译?
代码 int main void auto a 1 return 0 当文件具有 c 扩展名时 MS Visual Studio 2012 编译器可以正确编译该文件 我一直认为 当你使用 c扩展名时 编译应该按照C语法 而不是C 此外 据我
c
AUTO
C11
“decltype(auto)”变量有任何实际用例吗?
既来自我的个人经验 也来自咨询诸如此类的问题的答案decltype auto 有哪些用途 https stackoverflow com questions 24109737 what are some uses of decltypeau
c
c14
AUTO
typededuction
decltypeauto
C++ - 自动返回引用和非引用类型
当编写函数时auto我们可以使用的返回类型constexpr if返回不同类型 auto myfunc constexpr if someBool type1 first something return first else type2
c
reference
AUTO
rvalue
lvalue
auto 和 __auto_type 有什么区别吗?
我一直在使用 auto type在 C 语言中已经有一段时间了 我想知道它与auto在C 中 它们的实施方式不同吗 我尝试过搜索这个 但它没有产生任何结果 因为搜索C 中的 auto type返回有关的文章auto在C 中 感觉就像一个被遗
c
keyword
typeinference
AUTO
在 C++14 中使用自动返回“类型”进行显式模板专业化是否有效?
上一个问题 https stackoverflow com questions 27629039 c explicit return type template specialisation 我重复上一个问题中的代码以使这个问题独立 如果使
c
C11
AUTO
c14
explicitspecialization
1
2
3
4
»