腾讯云
开发者社区
文档
建议反馈
控制台
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
登录/注册
精选内容/技术社群/优惠产品,
尽在小程序
立即前往
文章
问答
(9999+)
视频
沙龙
2
回答
为什么
`
std
::
add_pointer
`,
会
添加
一个
之前
移除
的
`
const
`?
c++
、
c++11
、
typetraits
const
* 现在,当我使用
std
::remove_pointer删除
const
*部分,并使用
std
::
add_pointer
在没有
const
的
情况下
添加
回指针时,常量再次出现。
为什么
?typedef typename
std
::
add_pointer
<rp_Type>::type p_Type; // int
const
* <?
浏览 13
提问于2020-01-06
得票数 0
回答已采纳
4
回答
删除模板C++中
的
常量限定符
c++
、
constants
我试着使用
std
::remove_cv,但它不起作用。
std
::remove_cv<
const
char *>::type谢谢。
浏览 0
提问于2012-12-17
得票数 1
回答已采纳
2
回答
如何从“char
const
*”中删除常量
c++
、
c++11
看起来
std
::remove_
const
不能删除
const
char*
的
常量。::cout << typeid(T).name() <<
std
::endl; } { S
浏览 2
提问于2012-11-21
得票数 6
回答已采纳
2
回答
在指针对成员和指针到连接成员之间进行转换。
c++
、
compiler-errors
、
constants
、
pointer-to-member
我试着去寻找这个,但是我想到
的
每
一个
学期都会得到完全不相关
的
结果。 // DoSomething<C, T
const
>(
const
_cast<T
const
* C::*>(arr), siz); // works MyStruct_si
浏览 4
提问于2013-11-09
得票数 1
2
回答
将
std
元组解压成指针?
c++
、
c++11
假设我有
一个
元组我可以这样做:B b;
std
::tie(a, b, c) = myFavoriteTuple但是,如果其中一些元组复制起来确实很昂贵,我真正想要
的
是引用或指针指向元组中
的
正确位置。我可以这样做:B* b = &
std
::get<1&g
浏览 0
提问于2013-05-16
得票数 11
回答已采纳
1
回答
向
std
::tuple<Types...>
添加
指针和
const
c++
、
c++11
、
templates
、
partial-specialization
我试图使用C++11模板
的
魔力实现以下目标:using my_types =
std
::tuple<char, int, float>;
std
::tuple<char *, int *, float *,
const
char *,
const
int *,
const
float *>; 我现在
的
解决
浏览 2
提问于2016-12-19
得票数 2
回答已采纳
2
回答
Typedef应在"“
之前
输入”;“
c++
、
function
、
function-pointers
、
typedef
(不要因为使用
std
::auto_ptr<>而责怪我,这不是我
的
代码,它是自动生成
的
。我只是在尝试与之交互。)我有
一个
具有以下签名
的
函数:此函数重载了588次,因此将其分配给boost像这样输入很麻烦:
std
::auto_ptr<T>
浏览 4
提问于2013-05-23
得票数 1
回答已采纳
4
回答
限定为解密类型
c++
、
c++11
我第一次尝试使用decltype
const
decltype(&vals[0]) ptr; ptr我想要实现
的
是ptr成为
const
int*类型。我怎么才能让它起作用?谢谢。
浏览 1
提问于2016-06-30
得票数 1
回答已采纳
5
回答
C++
const
::map引用编译失败
c++
、
find
、
std
、
operator-keyword
、
stdmap
为什么
将对
std
::map
的
引用传递为
const
会
导致[]运算符中断?当我使用
const
时,我会得到这个编译器错误(gcc 4.2): void func(
const
char ch,
std
::string &str,
const
std
::map<
std
::string,
std
浏览 13
提问于2009-03-26
得票数 17
回答已采纳
1
回答
C++03/C++11中指针数组不稳定导致
的
链接错误
c++
、
c++11
、
constants
、
linker-errors
、
compiler-bug
这个问题在g++
之前
的
-
std
=c++14中是可以重现
的
。由于下面代码中所示
的
高亮显示
的
const
,
会
产生链接错误。如果
移除
RHS
const
,它就会消失。/* main.cpp *///
浏览 4
提问于2016-06-02
得票数 5
回答已采纳
2
回答
为什么
const
结构绑定允许用户修改引用
的
变量?
c++
、
c++17
即使我使用
const
和by(没有&)结构绑定,如本例所示:#include <tuple> {
std
::tuple<int&> p(x); a++;}如果我在&
之前</e
浏览 4
提问于2021-06-26
得票数 4
回答已采纳
1
回答
Boost mpl转换序列"real“类型
c++
、
templates
、
boost
、
boost-mpl
short*,int*,long*,float*,double*> pointers;BOOST_STATIC_ASSERT((
std
::is_same<result,pointers>::value )); //< assert fails
为什么
结果类型与我假设这是因为mpl正
浏览 0
提问于2013-02-20
得票数 4
回答已采纳
3
回答
根据对中
的
单个元素删除对向量
的
重复元素
c++
、
vector
所以我需要在文件中找到一些最常用
的
词。 对
浏览 4
提问于2016-09-26
得票数 0
回答已采纳
1
回答
将指向
const
字符串
的
指针
的
引用初始化为指向非
const
字符串
的
引用时出错
c++
、
string
、
c++11
、
pointers
、
reference
0;在编译此程序时,我收到
一个
错误,如下所示:
为什么
在引用
的
错误中
浏览 3
提问于2021-05-13
得票数 2
回答已采纳
1
回答
为什么
在编译c++程序时得到“未定义
的
引用”错误?
c++
、
makefile
我刚刚在.h文件中
添加
了
一个
函数定义,并在其相应
的
.cpp文件中实现了它。当我编译它时,我得到了这个编译错误:在Recognizer.h中,我<e
浏览 3
提问于2022-01-26
得票数 0
1
回答
如何使用boost::function_traits检查可调用
的
第
一个
参数
的
类型(如果有)?
c++
、
boost
::make_shared< CallbackImpl< Callable > >(
std
::forward< Callable >( func ) );};现在我需要<e
浏览 22
提问于2022-07-14
得票数 1
2
回答
为什么
在用转换构造函数编译代码时需要
const
复制构造函数?
c++
我在A.h有这样
的
课程:public:
std
::cout << "convert";
std
::cout << "copy";};A a = new int; 从“A”类型
的
r值初始化“A&”类型
的
非
c
浏览 0
提问于2018-05-22
得票数 3
2
回答
在移动构造函数
的
脓肿中,复制构造函数被调用?
为什么
会
这样呢?
c++
、
c++11
、
move-constructor
假设我有以下
的
粗略代码{ foo() {
std
::cout << "Copy constructor \n";} {
std
::cout}
浏览 7
提问于2014-08-23
得票数 2
回答已采纳
3
回答
最佳匹配函数与其它函数
的
模糊度
c++
、
overloading
) { ; }#else{};main() S s; return EXIT_SUCCESS; error: call tomember function 'f' is ambiguous 当我
移除
const
-qu
浏览 6
提问于2016-01-15
得票数 5
回答已采纳
1
回答
无法捕获模板专门化方法引发
的
异常
c++
、
templates
、
template-specialization
process_core(request); catch(
const
std
::exception& e)
std
::cout<
std
::string>::process_core(
const
std
::string& s)
std
::cout << "string_handler" <<
std</
浏览 2
提问于2017-12-25
得票数 3
回答已采纳
点击加载更多
扫码
添加站长 进交流群
领取专属
10元无门槛券
手把手带您无忧上云
相关
资讯
实现线程安全队列——细粒度锁实现
C++20:核心语言
C+实现xml解析器
C+23 特性概览
Socket网络编程之UDP客户端
热门
标签
更多标签
云服务器
ICP备案
实时音视频
即时通信 IM
对象存储
活动推荐
运营活动
广告
关闭
领券