隐式转换在更新 MySQL 连接器后停止工作

Implicit Conversion stopped working after updating MySQL Connector

我最近将我的 MySQL 连接器 C++ 升级到 v8.0.16,这导致我的项目编译期间出现问题。

所有错误都来自将 "mysql::abi2::r0::Value" 转换为不同的类型。 例如,我的一个函数中有这段代码:

std::string s; 
sql::Row res; 

... Fetching from database ... 

s = row[0]; // Here is the error 

我遇到的错误是:

no suitable user-defined conversion from "mysqlx::abi2::r0::Value" to "std::string" exists

但是如果我使用强制转换就可以了:

s = (std::string)row[0]; // No error here 

在以前的MySQL Connector C++ 版本中我没有遇到这个问题。

我已经检查过 MySQL 连接器的 mysqlx::abi2::r0::Value class 确实实现了允许隐式转换的运算符 std::string 所以我的代码有什么理由行不通?

提前致谢!

显然,MySQL 已经将 std::string 和 bool 隐式转换现在显式转换,所以这就是我的问题的根源。