Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/algorithm/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/apache-flex/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Algorithm 多索引中的多个唯一键_Algorithm_Stl_Boost Multi Index - Fatal编程技术网

Algorithm 多索引中的多个唯一键

Algorithm 多索引中的多个唯一键,algorithm,stl,boost-multi-index,Algorithm,Stl,Boost Multi Index,我正在尝试将对象存储在boost多索引容器中 这些对象都是唯一的,可以通过两个单独的键(也唯一)检索 但是它没有编译,我得到了以下错误 error: invalid conversion from ‘int’ to ‘const char*’ 当我对字符串使用相同的代码时,效果很好;你知道我做错了什么吗?auto-it=cntr\uu.get().find(id); auto it = cntr_.get<1>().find(id); 每个索引都可以单独访问(通过get),并且

我正在尝试将对象存储在
boost多索引
容器中

这些对象都是唯一的,可以通过两个单独的键(也唯一)检索

但是它没有编译,我得到了以下错误

error: invalid conversion from ‘int’ to ‘const char*’
当我对字符串使用相同的代码时,效果很好;你知道我做错了什么吗?

auto-it=cntr\uu.get().find(id);
auto it = cntr_.get<1>().find(id);

每个索引都可以单独访问(通过
get
),并且有自己的成员函数、迭代器等(如果您不能使用
auto
它属于
Cntr::nth\u index::type::iterator
)有关文档的更多信息。

Hi!刚刚注意到你是创造自由的人!!!啊!!不错的东西,写的代码少了好几行很高兴知道它有用:-)
error: invalid conversion from ‘int’ to ‘const char*’
auto it = cntr_.get<1>().find(id);