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

Compilation fails in c++20 #55

Open
vvkphys opened this issue Aug 5, 2024 · 0 comments
Open

Compilation fails in c++20 #55

vvkphys opened this issue Aug 5, 2024 · 0 comments

Comments

@vvkphys
Copy link

vvkphys commented Aug 5, 2024

The code does not work with C++20.

Apptainer> make
[ 0%] Built target atlas_tests
[ 0%] Built target Package_bjoern-andres-graph
[ 11%] Building CXX object GraphTest/CMakeFiles/GraphTestLib.dir/src/GraphTestAlg.cxx.o
In file included from /srv/build/_deps/bjoern-andres-graph-src/include/andres/graph/detail/graph.hxx:6,
from /srv/build/_deps/bjoern-andres-graph-src/include/andres/graph/graph.hxx:17,
from /srv/athena-graph/GraphTest/src/GraphTestAlg.cxx:4:
/srv/build/_deps/bjoern-andres-graph-src/include/andres/random-access-set.hxx: In instantiation of 'class andres::RandomAccessSet<andres::graph::Adjacency<> >':
/srv/build/_deps/bjoern-andres-graph-src/include/andres/graph/detail/graph.hxx:30:23: required from here
/srv/build/_deps/bjoern-andres-graph-src/include/andres/random-access-set.hxx:35:49: error: no type named 'const_reference' in 'class std::allocator<andres::graph::Adjacency<> >'
35 | typedef typename Allocator::const_reference const_reference;
| ^~~~~~~~~~~~~~~
/srv/build/_deps/bjoern-andres-graph-src/include/andres/graph/detail/graph.hxx:63:5: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
63 | value_type operator*() const;
| ^~~~~~~~~~
/srv/build/_deps/bjoern-andres-graph-src/include/andres/graph/detail/graph.hxx:64:5: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
64 | value_type operator[](const std::size_t j) const;
| ^~~~~~~~~~
/srv/build/_deps/bjoern-andres-graph-src/include/andres/graph/detail/graph.hxx:160:8: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
160 | inline typename IteratorHelper::value_type
| ^~~~~~~~
/srv/build/_deps/bjoern-andres-graph-src/include/andres/graph/detail/graph.hxx:171:8: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
171 | inline typename IteratorHelper::value_type
| ^~~~~~~~
make[2]: *** [GraphTest/CMakeFiles/GraphTestLib.dir/build.make:76: GraphTest/CMakeFiles/GraphTestLib.dir/src/GraphTestAlg.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:320: GraphTest/CMakeFiles/GraphTestLib.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

If you check, the type in question was removed with C++20.

https://en.cppreference.com/w/cpp/memory/allocator

Is it possible to make this code working with C++20?

Best regards,
Vadim

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

No branches or pull requests

1 participant