stdany 问答列表

std::optional<std::any> 和 has_value() 之间的交互

作者:Daniel Tyebkhan 提问时间:8/20/2023

出于调试目的,我正在编写一个函数,该函数遍历任何类型的可选变量的向量以检查哪些变量已初始化,但对所有变量的检查都返回,尽管从未为其中一些变量分配过任何值。has_value()true 我将不胜感激...

C++ 将 std::any 转换为基类,而不知道派生类类型

作者:Gamaray 提问时间:4/15/2023

这里有一个有点晦涩的问题,但我需要一种方法来转换为它的基类,而不知道它是什么派生类。std::any 换句话说,给定一个基类: struct HCallable { int numArgs; ...

将 std::any 转换为 std::tuple

作者:ilarcangelo 提问时间:11/6/2023

我有这段代码...... class TableModel { public: TableModel(std::vector<std::string> header = {}, std::st...


共3条 当前第1页