Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qualify call to as_const #106

Closed
wants to merge 1 commit into from

Conversation

danieljames
Copy link
Contributor

std::as_const was added to C++17 which makes the call ambiguous.

You can see the error at https://www.boost.org/development/tests/develop/developer/output/teeks99-02-dc5-1z-lc-Docker-64on64-boost-bin-v2-libs-graph-test-test_graphs-test-clang-linux-5-0~c++1z~lc-debug.html

In file included from ../libs/graph/test/test_graphs.cpp:18:
In file included from ../libs/graph/test/test_graph.hpp:95:
../libs/graph/test/test_properties.hpp:24:28: error: call to 'as_const' is ambiguous
GraphBundle const& cb1 = as_const(g)[graph_bundle];
                        ^~~~~~~~
../libs/graph/test/test_properties.hpp:120:3: note: in instantiation of function template specialization 'test_graph_bundle<boost::adjacency_matrix<boost::directedS, VertexBundle, EdgeBundle, GraphBundle, std::__1::allocator<bool> > >' requested here
test_graph_bundle(g, graph_bundled);
^
../libs/graph/test/test_graph.hpp:133:5: note: in instantiation of function template specialization 'test_properties<boost::adjacency_matrix<boost::directedS, VertexBundle, EdgeBundle, GraphBundle, std::__1::allocator<bool> >, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > >' requested here
    test_properties(g, verts);
    ^
../libs/graph/test/test_graphs.cpp:132:5: note: in instantiation of function template specialization 'test_graph<boost::adjacency_matrix<boost::directedS, VertexBundle, EdgeBundle, GraphBundle, std::__1::allocator<bool> > >' requested here
    test_graph(g);
    ^
/usr/include/c++/v1/utility:291:50: note: candidate function [with _Tp = boost::adjacency_matrix<boost::directedS, VertexBundle, EdgeBundle, GraphBundle, std::__1::allocator<bool> >]
template <class _Tp> constexpr add_const_t<_Tp>& as_const(_Tp& __t) noexcept { return __t; }
                                                ^
../libs/graph/test/test_properties.hpp:12:31: note: candidate function [with T = boost::adjacency_matrix<boost::directedS, VertexBundle, EdgeBundle, GraphBundle, std::__1::allocator<bool> >]
template<typename T> T const& as_const(T& x) { return x; }

`std::as_const` was added to C++17 which makes the call ambiguous.
@danieljames
Copy link
Contributor Author

Sorry, duplicate of #85.

@danieljames danieljames closed this Apr 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant