腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
文章
问答
(9999+)
视频
沙龙
1
回答
` `
const
std
::
string&
`
参数
的
“
任何
值
”
、
我有一个以
const
std
::string &为
参数
的
函数。我想写这样
的
东西: EXPECT_CALL(mock, convertString(A<
std
::string>())).Times(0); 这会导致编译失败: no known conversionfor argument 1 from 'testing::Matcher<
std
::basic_string<char> >' to '
浏览 34
提问于2019-03-19
得票数 2
3
回答
可以通过
const
引用返回默认
参数
的
值
吗?
、
、
、
、
通过
const
引用返回默认
参数
的
值
可以吗,如下面的示例所示: {} {
const
std
浏览 9
提问于2019-11-01
得票数 26
1
回答
使用默认模板
参数
、
、
、
、
我可以做: return right < left;};
std
::priority_queue<
std
::string,
std
::vector<
std
::string>, decltype(cmp_fn)> queue(
浏览 2
提问于2017-04-19
得票数 2
回答已采纳
1
回答
在getter之前
的
&-符号是什么意思?
getter之前
的
“&”是什么意思?
const
std
::string &getName()
const
{} getter是由CLion ide生成
的
。
浏览 0
提问于2015-05-25
得票数 1
3
回答
如何只将选定
的
参数
传递给函数?
、
、
、
我希望区分要传递给函数
的
哪个
参数
,并根据提供
的
参数
创建并返回该对象。我很好奇是否应该在c++中使用各种模板?伪码。#include <iostream> { string b;} XgenerateTransaction(
const
string&
e,
const
string&</e
浏览 10
提问于2022-09-13
得票数 1
回答已采纳
1
回答
获取非静态方法
参数
计数。
这里有一些可行
的
答案,可以计算
参数
函数所使用
的
数量:void foo(
const
std
::
string&
,
const
std
::
string&
,
const
std
::
string&
,
const
std
::
string&
,
浏览 0
提问于2018-01-18
得票数 1
回答已采纳
3
回答
带有默认
参数
的
Doxygen重复c++函数
、
我有一个使用默认
参数
的
函数,它在头文件中指定,即:unsigned int CountColumns(
const
string&
input,
const
st
浏览 0
提问于2012-08-29
得票数 5
回答已采纳
3
回答
在函数返回与模板
参数
相同
的
情况下,如何将函数作为模板parmater传递?
、
、
std
::
string&
x_str,
const
std
::
string&
y_str) x = Fn(x_str);template<typename T, T Fn(
const
std
::
string&
)>我得到了各种错误,比如不能从‘重载-函
浏览 0
提问于2017-12-06
得票数 0
回答已采纳
1
回答
如何使用
std
::stoi作为默认
值
创建
std
::function作为方法
参数
?
、
、
、
我希望使用
std
::function作为方法
的
参数
,并将其默认
值
设置为
std
::stoi。我尝试了以下代码:不幸
的
是,我得到了以下错误: no viable conversion from
浏览 6
提问于2013-12-17
得票数 6
回答已采纳
3
回答
具有转发到唯一方法
的
C++11重载方法
、
我在c++11中有以下课程:#include <string> someStuffHerevoid overloaded_function(
std
::string&& param) { someStuffHere我希望创建一个新函数,而不是将相同
的
实
浏览 1
提问于2018-04-09
得票数 8
回答已采纳
1
回答
字典文件管理器类
、
我想知道检查字典成员函数
的
参数
是否为有效术语/定义
的
最佳方法。我已经想出了两种可能
的
解决方案,但我对
任何
其他解决方案都持开放态度。我可以检查传递给函数
的
参数
,也可以创建一个term和definition类,然后让类进行检查。::
string&
term,
const
std
::
string&
definition){
浏览 0
提问于2015-07-31
得票数 0
1
回答
字典文件管理器
、
、
我想知道检查我
的
字典成员函数
的
参数
是否是有效术语/定义
的
最佳方法。我曾想过两种可能
的
解决办法,但我愿意接受
任何
其他
的
解决办法。我可以检查传递给函数
的
参数
,或者创建一个术语和定义类,然后让类检查。::
string&
term,
const
std
::
string&
definition){
浏览 0
提问于2015-07-30
得票数 1
回答已采纳
2
回答
如何通过函数分配
std
::string?
那么,如何通过函数分配
std
::string呢?我有这个密码{struct NESSIEstructcharNESSIEinit(&whirlpool_ctx); b
浏览 3
提问于2015-06-07
得票数 0
回答已采纳
4
回答
构造函数重载和默认
参数
、
基类是一个简单
的
“项目”,有一个标题、作者、项目编写
的
年份和一些注释。我希望在构建项目时,标题和作者字段是任务字段,但另一个字段是可选
的
。因此,我编写了一个构造函数,其中两个
参数
是可选
的
。;
const
std
::string &a,
const<
浏览 5
提问于2016-03-13
得票数 2
回答已采纳
2
回答
如何迁移在新设计中需要一些额外
参数
的
函数?
我们有一个现有的类方法,它接受两个字符串作为
参数
:在许多地方都有同样
的
功能。现在,我需要修改相同
的
内容,以传递另外两个整数
参数
: bool myfunc(
const
std
::
string&
var1,
co
浏览 1
提问于2018-07-09
得票数 0
回答已采纳
2
回答
作为函数
参数
的
字符串对
的
C++向量
的
默认规范在gcc-4.1.2上无效?
、
、
、
、
这作为x64 VS100 (MSVC++ 2010)上
的
函数声明
的
参数
构建得很好,但在RHEL5上失败(gcc 4.1.2):
const
std
::vector<
std
::pair<
std
::stringbool func(
const
std
::
string&
,
const
std
::vector<int>&,
const
浏览 3
提问于2013-09-19
得票数 0
回答已采纳
3
回答
如何声明接受转发引用并返回引用或副本
的
函数模板
、
、
to);
std
::
string&
StringReplace(
std
::
string&
str,
const
std
::
string&
from,
const
std
::
string&
to); string StringReplace(
const
:
浏览 1
提问于2018-03-17
得票数 1
回答已采纳
3
回答
通过引用,多态方法
的
可选
参数
?
我有一个像这样
的
多态方法层次结构:我想要传递一个在方法中修改
的
“可选”
参数
:但是我收到错误,我
的
引用没有初始化。
浏览 0
提问于2016-06-29
得票数 3
2
回答
对向量
的
lower_bound比较器
、
、
、
、
我想为对向量做lower_bound,但我只想用它来表示对
的
第一个元素。我试图像这样做我自己
的
比较器: auto finder =
std
::lower_bound(words_.begin(), words_.end(), key, [](
const
std<
浏览 22
提问于2022-07-01
得票数 -1
回答已采纳
3
回答
模板/预处理器黑客可以用来支持
参数
列表中间
的
变量
参数
吗?
、
、
、
我偶然发现了这样
的
旧代码:
const
std
::
string&
testString1,
const
std
::
string&
file,
const
std
::
string&
defaultString = "
浏览 0
提问于2015-08-03
得票数 7
回答已采纳
点击加载更多
热门
标签
更多标签
云服务器
ICP备案
对象存储
实时音视频
云直播
活动推荐
运营活动
广告
关闭
领券