仅提供English版本
When using the count(const) algorithm in STL, an error operator not found which takes a left operand of type 'const _Ty' occurred.
The reason is that the custom doubly linked list class did not overload the left operator ==. Adding the overload operation fixes it.
Author: Broccoli
Copyright Notice: All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.
Related Articles
2022-06-10
C++ Check if Process is Running
References: Find process ID by name and inject to it. Simple C++ example.C++ Get process handle by process name The function is mainly for the auto-update service, executing subsequent functions after detecting that the program has exited. When using the second reference, an error occurred. I found it was a stack overflow in the for loop, likely due to the field determination function, causing every program name to be judged correct. I recommend adopting the content from the first URL. code...

2020-12-31
c++ 虚继承
之前看过一段时间c++,但是一直没有找到合适的项目进行熟悉,所以在跟着github的一个开源项目学习c++,地址为:github 12345678910111213141516171819202122232425262728293031323334353637383940414243444546/* * 虚继承 * 概念:解决从不同途径继承来的同名数据成员在内存中有不同拷贝造成的数据不一致问题,将共同的基类设置为虚基类。 * 这时从不同的路径继承过来的同名数据成员在内存中就只有一个拷贝,同一个函数名也只有一个映射 * 解决问题: * 解决了二义性问题,也节省了内存,避免数据不一致问题 * * 分析: * 从程序中可以看到,C,D,E不同的继承类型为三种 public A,virtual A与virtual B,其中两次使用了virtual B * 第二次的继承将会直接引用第一次的拷贝,所以我们会看到控制台对于C,D部分的输出为B-A-A其中第二次B被省略 * 按照继承的原则首先基类,生成C-D,然后成员为A,最后为E,所以顺序为:B-A-A-C-D-A-E * */# inclu...
2020-06-14
C++ Primer & PrimerPlus Notes
OneSaw a case in C++ primerplus Chapter 6 Branching Statements, 12345678910111213141516171819202122232425262728293031 char ch; cout << "Typr , and I shell repeat.\n"; cin.get(ch); while (ch != '.') { if (ch == '\n') cout << ch; else cout << ch +1; cin.get(ch); } cout << "\n Please excuse thr slight confusion.\n";``` When we replace `cout<<ch+1` with `cout<<++ch`, two different results appear:- ch+1
2021-05-09
Use C++ for Revit Secondary Development
Since VC++ is compiled in CLR, it cannot achieve encryption effect. If you want to protect your code, it is recommended to use C++ for core algorithms and C# for interaction. While making component library, considering database connection code might be decompiled, I used WCF to interact with server data in previous version, articles can be found in my previous posts. But recently learning QT and trying to use QT+C++ or VC++ development to see effect, so simply wrote a demo developed by c++.R...
Announcement
欢迎访问!右上角可切换中英文。感谢您的阅读!

