腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
文章
问答
(9999+)
视频
沙龙
3
回答
static_cast
<
int
>(
foo
)
vs.
(
int
)
foo
、
有没有人能详细解释一下不同之处?
浏览 0
提问于2009-01-24
得票数 30
回答已采纳
4
回答
foo
(
int
,
int
)被选中而
foo
(
int
.)
、
、
、
private static void doSomething(
int
... nums) {} System.out.println("2");} JDK 17正在抱怨Cannot make a static refe
浏览 6
提问于2022-06-28
得票数 3
回答已采纳
1
回答
"
foo
(
int
*指针)“与"
foo
(
int
* &指针)”
、
在以下代码中:using namespace std; { pointer= &
foo
;{ pointer = &
foo
;{
浏览 3
提问于2017-04-30
得票数 0
回答已采纳
4
回答
int
foo
(
int
argc,.)在C中vs
int
foo
() vs
int
foo
(void)
、
、
所以今天我第一次意识到,
int
foo
()实际上不同于
int
foo
(void),第一个允许任意数量的输入,第二个允许零输入。
int
foo
()会忽略任何给定的输入吗?如果没有,您如何访问它们,这与拥有变量参数列表(例如,类似于
int
foo
(
int
argc, ...))有什么不同?
浏览 1
提问于2012-03-20
得票数 5
回答已采纳
1
回答
‘`
int
foo
() {}` vs ` `
int
foo
(void) {}’在声明“`
int
foo
(Void)之后”的定义;
、
注意,
foo
1 和
foo
2 都声明为零参数函数;唯一的区别是实现,而不是声明:
int
foo
2(void); printf("%d\n",
foo
浏览 0
提问于2020-03-03
得票数 4
回答已采纳
2
回答
int
foo
=
foo
的标准参考
、
int
foo
=
foo
;编译。C++标准的哪个部分允许这样做?
浏览 1
提问于2011-05-31
得票数 19
回答已采纳
1
回答
具有完全模板专门化的CRTP
template <typename T>public: } class A: public B<A<X>> { X
浏览 0
提问于2021-01-11
得票数 1
3
回答
为什么std::转发引用是必要的
、
、
、
、
在这样的函数模板中void
foo
(T&& x) {} 如果用rvalue引用调用x,那么
foo
不是
foo
内部的rvalue引用吗?如果
foo
是用lvalue引用调用的,那么强制转换是不必要的,因为x也将是
foo
中的lvalue引用。另外,T将被推导为lvalue引用类型,因此std::forward<T>不会更改x的类型。main(
int</e
浏览 7
提问于2017-02-18
得票数 7
回答已采纳
1
回答
重载模板函数的Constexpr别名
、
、
我最好的尝试:constexpr auto newfoo =
static_cast
<std::shared_ptr<
foo
>(*)(
int
)>(std::make_shared<
foo
>);error: invalid
static_cast
from type ‘<unreso
浏览 4
提问于2017-09-14
得票数 8
回答已采纳
3
回答
func
foo
(arr []
int
)
int
和func
foo
(arr [num]
int
)
int
有什么区别?
、
、
、
func
foo
(arr []
int
)
int
和func
foo
(arr [*num*]
int
)
int
有什么区别?以下是两个例子: arr[0] = 1} arr[0] = 1} func mai
浏览 5
提问于2017-06-23
得票数 2
回答已采纳
2
回答
如何将带有
int
参数的信号连接到具有枚举参数的插槽,而无需在QT5中使用lambdas?
、
、
、
我知道所有这些方法都行不通: 因为在C/C++中,
int<
浏览 6
提问于2015-12-16
得票数 1
2
回答
static_cast
<T>对T&做什么?
、
、
、
、
所以我问了,我正在用
static_cast
来解决这个问题。(顺便提一句,它确实解决了这个问题,我只是不确定我是否理解原因。)在守则中:replace(begin(
foo
), end(
foo
),
static_cast
<
int
>(
foo
.front()), 13);
static_cast
仅仅是构造一个R值
int
浏览 4
提问于2016-06-22
得票数 7
回答已采纳
4
回答
foo
(
int
* arr)和
foo
(
int
arr[])有什么区别吗?
foo
(
int
* arr) {}
foo
(
int
arr[]){}? 谢谢
浏览 1
提问于2011-03-31
得票数 5
回答已采纳
3
回答
为什么"
foo
=新双[
int
,
int
]“是合法的,而不是"
foo
=新双[
int
][
int
]”?
、
、
、
法律:{ public Banana(
int
h,
int
w) _banana}public class Banana double[][] _banana; { }
浏览 4
提问于2014-07-08
得票数 0
回答已采纳
3
回答
原型"const
int
*
foo
(
int
)“是什么意思,尤其是与"
int
*
foo
(
Int
)”相比?
、
、
、
我知道
int
*
foo
(
int
)原型意味着
foo
是一个接受整数参数并返回指向integer.But的指针的函数,下面的意思是什么?const
int
*
foo
(
int
); 我试着去推理,但是书中没有提到这一点,但是我在库函数prototypes.So中看到了类似这样的东西,请告诉我这是什么意思。
浏览 2
提问于2013-05-14
得票数 2
回答已采纳
1
回答
转换为void指针时是否丢弃该值?
代码:{public: ~CFoo(){}}; { std::cout << "Number: " <<
foo
->getNum();}
浏览 0
提问于2017-06-10
得票数 0
1
回答
为什么我可以
static_cast
无效*到
int
*而不是
int
*&?
、
、
为了表达我的偏移算法,我尝试这样做{}x.cpp:7:28: error: invalid
static_cast
from type‘void*’
浏览 0
提问于2018-02-18
得票数 2
回答已采纳
2
回答
显式构造函数与
static_cast
、
、
struct
Foo
explicit
Foo
(
int
a):m(a){}}; Bar(11); // OK, gives error x.m;即使
static_cast
的构造函数标记为ex
浏览 2
提问于2015-09-22
得票数 4
回答已采纳
3
回答
如何指示某些过载函数?
<typename T, typename F>{} {} {}v
浏览 1
提问于2017-11-29
得票数 1
回答已采纳
1
回答
是否可以使用自动占位符来推导非类型模板参数的函数结果?
、
、
、
考虑一个简单的例子:struct
Foo
{};
static_cast
<void>(
Foo
<bar>{});和似乎都接受代码。template <class T, auto(*X)(T)> decltype(X(0)) x;
int</
浏览 10
提问于2018-01-28
得票数 9
回答已采纳
点击加载更多
相关
资讯
成员函数指针做回调参数总结 踩坑
Java的泛型编程与多态,重载的同与不同
Uber正式开源Go语言编程规范,内部已使用多年
go语言面向对象编程
Python常见的错误处理方法
热门
标签
更多标签
云服务器
ICP备案
云点播
对象存储
即时通信 IM
活动推荐
运营活动
广告
关闭
领券