调试时ADL和重载分辨率

时间:2016-12-29 04:03:20

标签: c++ debugging boost argument-dependent-lookup

Boost非常好,但许多最酷的库大量使用ADL和模板推理,据我所知,在调试环境中是不可能的。说,我正在使用BGL,我想访问具有特定顶点的属性映射。代码只是get(index_property_map, v)(例如)并且会编译文件,但如果我想在GDB中调试时运行相同的代码怎么办?我想知道是否有某种方法可以做到这一点我无法找到。

我知道这有点复杂,可能需要编译器集成才能正常工作,并且在调试时会检测到当前的“位置”。我也知道你可以手动(如果繁琐地)指定模板参数,但是当你有这样的签名时

boost::get<boost::function_property_map<algo::ScheduleToGraphAdapter::get_vertex_index_map() const::{lambda(algo::detail::STGA::vertex_descriptor const&)#1}, algo::detail::STGA::vertex_descriptor, unsigned long>, unsigned long, algo::detail::STGA::vertex_descriptor>(boost::put_get_helper<boost::function_property_map<algo::ScheduleToGraphAdapter::get_vertex_index_map() const::{lambda(algo::detail::STGA::vertex_descriptor const&)#1}, algo::detail::STGA::vertex_descriptor, unsigned long>, boost::function_property_map<algo::ScheduleToGraphAdapter::get_vertex_index_map() const::{lambda(algo::detail::STGA::vertex_descriptor const&)#1}, algo::detail::STGA::vertex_descriptor, unsigned long> > const&, algo::detail::STGA::vertex_descriptor const&)

如果你愿意,你甚至不能这样做,因为GDB不会解析它(被lambda部分弄糊涂)。另外......有时候你甚至不知道要查找什么名称空间,这会使任何帮助标签完成失败。所以,是的,有没有办法做模板重载&amp;在调试器中ADL?

0 个答案:

没有答案