“无法将函数定义与现有声明匹配”,当包装在 std::vector 中时
“unable to match function definition to an existing declaration” when wrapped in std::vector
为什么这不起作用?我试过在那里扔一个额外的类型名,但无济于事。
class binary_reader
{
public:
template <typename Type>
Type read();
};
template <typename Type>
std::vector<Type> binary_reader::read()
{
...
}
在类声明中,使用 Type
作为返回值,但在方法实现中,使用 std::vector<Type>
作为返回值。
更改类声明或实现,它将起作用。
相关文章:
- std::vector的包装器,使数组的结构看起来像结构的数组
- 如何在c++迭代器类型中包装std::chrono
- 将函数包装器转换为 std::function
- std::reference_wrapper 打开包装器
- 将 std::vector<double> 从 C++ 包装到 C 以在 Swift 中使用
- std::带有颜色和标题的 clog 包装器无法正确打印整数
- 将对象传递给函数而不将其包装到 std::ref 中,而参数被指定为 const 引用
- 使用"std::enable_if"转发包装失败
- std::包含 std::函数回调的多个包装器的向量不起作用
- pybind11:如何包装以 std::vector<double> 为参数以避免数据复制的 C++ 函数
- 在同一接口中包装不同的 std::vector<T>
- 包装 std::istream 时出现问题,移动后unique_ptr不为空
- Swig:如何从SwigpyObject获取包装std :: shared_ptr的值
- SWIG:包装 std::map<key 时编译器错误,val *>
- SWIG-包装STD ::一对串时的内存泄漏
- 包装 std C++功能有时是一个坏主意
- 使用 boost::p ython vector_indexing_suite 包装 std::vector
- 在帮助程序方法中包装 std::get<>
- 包装std::忽略
- 在自定义类中包装std::packaged_task