C++14才有std::make_unique<T>(...)所以替换为std::unique_ptr<T>(new T(...))
原创 2022-06-13 13:53:34
825阅读
什么是std::length_error异常 长度错误。它报告由于试图超出某些对象的实现定义的长度限制而导致的错误。一般由std::basic_string和std::vector::reserve等成员函数抛出。 继承关系   异常结构填充 ExceptionAddress: 747cc5af (KERNELBASE!RaiseException+0x00000058)   Exception
转载 2020-12-03 08:13:00
6594阅读
2评论
#include using namespace std;然后编译时出现 error C2871: 'std' : does not exist or is not a namespace查了一下,原来 C++有两个不同版本号的头文件。引入名字空间这个概念曾经编译器用的是#include ,而引入名...
转载 2015-04-03 14:18:00
183阅读
在VC++种同时包含头文件#include <windows.h>和#include <algorithm>后就会出现无法正常使用std标准库中的min和max模板函数,经过查阅发现这是因为在Windows.h种也有min和max的定义,这样就导致了algorithm中的min和max无法正常使用,
原创 2022-03-22 11:38:16
589阅读
错误:Making signal interposition lib...error: invalid argument '-std=gnu++98' not allowed with 'C'make[6]: *** [libjsig.dylib] Error 1make[6]: *** Waiting for unfinished jobs....generate-config.sh加上:LFLAGS += -stdlib=libstdc++
原创 2021-08-07 12:51:55
832阅读
主要原因:对一个空指针进行操作。 例如:char* p = NULL:string str(p);              //运行时报错   FILE* install_log = fopen_path(ins
原创 2023-09-06 14:03:10
368阅读
C++ Strings library std::basic_string Defined in header <string> int stoi( const std::string& str, std::size_t* pos = nullptr, int base = 10 );int sto ...
转载 2021-07-21 14:34:00
804阅读
2评论
我的错误原因是在定义结构体内变量并初始化时,误把整形赋值给了string变量。编译正常,运行的时候报错。
原创 2024-03-14 16:01:31
507阅读
错误:Making signal interposition lib...error: invalid argument '-std=gnu++98' not allowed with 'C'make[6]: *** [libjsig.dylib] Error 1make[6]: *** Waiting for unfinished jobs....解决办法,​
原创 2022-02-09 09:50:13
314阅读
Error 2 error C2784: 'bool std::operator <(const std::_Tree<_Traits> &,const std::_Tree<_Traits> &)' : could not deduce template argument for 'const s
转载 2018-06-01 15:28:00
116阅读
2评论
error: use of deleted function ‘std::atomic<short unsigned int>::atomic(const std::atomic<short unsigned int>&)报这个错误的主要原因是原子变量不能使用拷贝构造。这个限制只在原子变量初始时生效,初始之后时可以使用赋值操作符的。std::atomic<ui
原创 2022-03-27 16:58:48
1712阅读
error: use of deleted function ‘std::atomic<short unsigned int>::atomic(const std::atomic<short unsigned int>&)报这个错误的主要原因是原子变量不能使用拷贝构造。这个限制只在原子变量初始时生效,初始之后时可以使用赋值操作符的。std::atomic<ui
原创 2021-12-14 16:58:15
2854阅读
参考:C++11 std::move和std::forward ...
转载 2021-07-23 11:15:00
204阅读
2评论
 std::move是一个用于提示优化的函数,过去的c++98中,由于无法将作为右值的临时变量从左值当中区别出来,所以程序运行时有大量临时变量白白的创建后又立刻销毁,其中又尤其是返回字符串std::string的函数存在最大的浪费。 比如: 1 std::string fileContent = &ldquo;oldContent&rdquo;; 2 s = readFileCon
转载 精选 2012-08-04 12:12:23
1420阅读
修改cmake 将设置c++标准的 set(CMAKE_CXX_FLAGS "-std=c++11") 替换为 set(CMAKE_CXX_STANDARD 11) 可以解决 新版本cmake设置c++标准都是下面这种方法 转自: https://blog.csdn.net/hitljy/artic ...
转载 2021-06-28 23:56:00
2840阅读
2评论
Q: A: I could compile your code successfully with MSVC2013. However, thread() works passing copies of its argument to the new thread. This means that
原创 2022-07-11 13:05:43
352阅读
error: use of deleted function ‘std::pair<const int, int>& std::pair<const int, int>::operator=(const std::pair<const int, int>&)’ ir<const int, int>
原创 2022-10-14 15:10:37
755阅读
[Error] cannot pass objects of non-trivially-copyable type 'std::string {aka class std::basic_string&lt;char&gt;}' through '...'1. 报错[Error] cannot pass objects of non-trivially-copyable type 'std::...
原创 2021-07-13 11:49:22
1066阅读
[Error] cannot pass objects of non-trivially-copyable type 'std::string {aka class std::basic_string<char>}' through '
原创 2022-01-26 10:28:19
2200阅读
opencv自带的puttext函数,能够很方便地在Mat中添加英文字母。但是在实际项目中,甲方
原创 2022-12-25 06:45:53
196阅读
  • 1
  • 2
  • 3
  • 4
  • 5