c++警告C4114相同类型的限定符使用了不止一次

标签 c++ visual-c++

这个问题在这里已经有了答案:





warning C4114: same type qualifier used more than once

(2 个回答)


1年前关闭。




我收到警告:多次使用相同类型的限定符
使用这些原型(prototype):

static std::wstring joinWS(const vector<wchar_t*> Vect, const const char* delimiter);
static std::wstring joinWS(const vector<char*> Vect, const const char* delimiter);
wchar_t* 和 char* 是不同的。
有办法解决吗?
谢谢 !

最佳答案

const是类型限定符,你不应该像那样在同一个地方使用它两次。

"It’s like, how much more const could this be? And the answer is none. None more const." -- Bjarne Stroustrup

关于c++警告C4114相同类型的限定符使用了不止一次,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63846099/

相关文章:

c++ - vscode 智能感知不工作

c++ - 如何使用 css 更改 QStackedWidget 中 QWidget 的背景颜色?

c++ - 使用包含指针的 vector 或值 vector (以避免堆碎片)更好吗?

c++ - C mxe 链接失败 : ld cannot find symbols

c - int **p 的奇怪行为?

c++ - 以下具有多个参数的函数模板的返回类型应该是什么?

c# - 从 .Net Dll 创建 .Ocx 文件

c++ - 构造函数右括号处的无法访问的代码

c++ - 使用 Visual C++ 和 OpenCV 2.1 将 BMP 打开到数组

c++ - 没有 operator== 匹配 std::string?