CPOI and CWaypoint
CPOI and CWaypoint
我已经为像这样的+=运算符使用了运算符重载
CRoute& CRoute::operator+=(string name ){
CWaypoint *p=this->m_pWpDatabase->getPointerToWp(name);
if(p!=NULL){
this->addWaypoint(name);
}
else{
cout<<" Waypoint not found in DB "<<endl;
}
return *this;
}
现在我想做同样的操作+=将poi添加到我的路由中,我正在使用语法C路由&运算符+=(字符串namepoi);
但是我得到的错误消息是‘CRoute&CRoute::operator+=(std::string)'不能重载有人能帮忙吗??
建议的运算符重载函数的函数签名与当前存在的函数签名冲突。那么,如果您想为poi
创建运算符重载,为什么不能传递poi object
而不是它的名称呢?
相关文章:
- C++核心准则 C35 对于接口类"A base class destructor should be either public and virtual, or protected and nonv
- 为什么C++逐位AND运算符在不同大小的操作数中表现为这样
- 为什么 Clang 不允许"and"作为函数名称?
- 位阵列上的快速AND运算
- 是否可以在 C++03 中定义'move-and-swap idiom'等效项
- BoostPython and CMake
- OpenSSL BIO and SSL_read
- Gurobi GRBModel and GRBmodel in C++
- std::visit and std::variant usage
- SHBrowseForFolder with BIF_BROWSEFORCOMPUTER and SHGetPathFr
- Directx12 and keystrokes
- different between int **arr =new int [ n]; and int a[i][j]?
- C++ getenv and setenv
- Inference pytorch C++ with alexnet and cv::imread image
- Visual Studio 2019 C++ and std::filesystem
- 保证逻辑 AND 表达式中的函数调用
- python ctypes and C++ pointers
- C++ const char with .begin() and .end()
- Threads with Classes and std::packaged_task
- CPOI and CWaypoint