Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
如何在调用函数之前推断 auto?
在尝试时函数返回类型推导 http en wikipedia org wiki C 2B 2B14 Function return type deduction auto func int main func auto func retur
c
function
AUTO
c14
returntypededuction
为什么我可以在私有类型上使用 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
在 C++ 中使用 auto 声明变量有缺点吗?
看起来auto是 C 11 中添加的一个相当重要的功能 它似乎遵循许多较新的语言 与 Python 这样的语言一样 我没有看到任何显式的变量声明 我不确定是否可以使用 Python 标准 使用有什么缺点吗auto声明变量而不是显式声明它们
c
C11
typeinference
AUTO
具有统一初始化的 Auto 扩展为意外类型
考虑这个用 GCC 4 7 2 编译的短程序g std c 11 test cc include
c
C11
standards
AUTO
uniforminitialization
VS Code 自动导入不使用绝对路径且不缩进
我将 Typescript 与 SvelteKit 结合使用 当我输入可以自动导入的内容时 如上面的 GIF 所示 自动导入不会使内容保持相同的缩进级别 我还需要绝对路径 src not src VS 代码的设置称为 TypeScript
VisualStudioCode
import
AUTO
autoimport
为什么自动变量在通过字符串初始化时会被推导为指针?
include
c
C11
typeinference
AUTO
stringliterals
auto* 的类型推导规则是什么?
类型推导规则是什么auto 考虑以下 int x 64 int px x auto v1 x auto gt ok v1 is int auto v2 px auto gt is v2 int auto v3 px auto gt is v
c
templates
AUTO
decltype
typededuction
C++ 关键字 auto 有什么作用? [复制]
这个问题在这里已经有答案了 我最近在c 中遇到了关键字auto 在代码中 auto maxIterator std max element spec 0 spec sampleSize float maxVol maxIterator No
c
AUTO
fmod
身份函数:模板和自动的区别
我正在为我的一些类编写一个身份函数 用于记录其调用的计数 长话短说 指标 目前 我正在尝试计算使用模板与使用模板的性能差异 优点auto 这是从我正在做的代码中摘取的一个简短示例 namespace Metrics unsigned lon
c
templates
AUTO
C++11 中的自动引用
我有一些麻烦about自动参考 const int i 1 auto ri1 i auto ri2 1 error 为什么是推导类型ri1 const int但不是ri2 Thanks Since i有类型const int but 1有类
c
C11
constants
AUTO
使用“auto”的声明是否与使用具体类型说明符的 extern 声明匹配?
考虑以下程序 extern int x auto x 42 int main Clang 3 5 接受它 现场演示 GCC 4 9 和 VS2013 没有 前者的现场演示 谁是对的 C 标准中规定的正确行为在哪里 令人惊讶的是 标准中对此的
c
languagelawyer
extern
AUTO
auto it = vector.begin() 结果类型不可转换为 const_iterator
容器需要提供iterator可以隐式转换为的类型const iterator 鉴于此 我正在尝试使用auto通过初始化一个对象vector begin 并使用该结果对象std distance其中 RHS 是const iterator 这
c
C11
AUTO
implicitconversion
auto&& 变量不是右值引用
为什么 auto 不是右值引用 Widget var1 Widget rvalue reference auto var2 var1 var2 not rvalue reference 以下是右值参考示例 void f Widget par
c
C11
AUTO
forwardingreference
自动类型推导中的常量
我正在阅读 Scott Meyers 的 Effective Modern C 第 1 项包含以下示例 template
c
C11
reference
AUTO
effectivec
使用 C++11 的“auto”如何提高性能?
我明白为什么autoC 11 中的类型提高了正确性和可维护性 我读到它还可以提高性能 几乎总是自动作者 Herb Sutter 但这部分缺乏很好的解释 How can auto提高性能 谁能举个例子吗 auto可以通过以下方式提高性能避免静
c
performance
C11
AUTO
为什么一元减法会进行积分提升?
const auto min std numeric limits
c
AUTO
integerpromotion
为什么“自动”和显式引用变量声明的行为不同?
我有这样的事情 class Bar class Foo public Foo bar new Bar Bar GetBar return bar get private std unique ptr
c
C11
reference
AUTO
初始化器列表返回的生命周期扩展
所以我有一个 lambda 其返回类型是auto我在阵列支持方面遇到问题initializer list在这里被摧毁 const auto foo const auto a const auto b const auto c return
c
Lambda
Return
initializerlist
AUTO
具有引用非类型模板参数的模板是否应该与具有自动非类型模板参数的模板模板参数相匹配?
template
c
languagelawyer
AUTO
templatetemplates
nontypetemplateparameter
auto 关键字在 Dev C++ 中不起作用[重复]
这个问题在这里已经有答案了 这是我写的代码 看看如何auto关键字有效 但它没有在 Dev C 中编译并给出以下警告 警告 C 11 auto 仅适用于 std c 11 或 std gnu 11如何克服这个故障并按照警告的指示去做 inc
c
vector
compilererrors
devc
AUTO
«
1
2
3
4
»