Closed andreadimax closed 1 year ago
Hi, thanks for reporting! As far as I understand, this repo is not maintained at the moment. I maintained this while I was working at Improbable, I now maintain my own fork here: https://github.com/tzaeschke/phtree-cpp
I tried reproducing it with the latest version of my fork and I cannot reproduce it (Ubuntu 22.04, GCC 11.3.0). My fork underwent some major refactoring, so this problem may have been fixed on the way. Note that the paths have changed, everything was moved to a subfolder include
.
Could you try the version from my repo? If the issue persists, could you raise an issue over there?
Forked your newer repo and it works! Thank you!
Compilation error when trying to use FilterSphere in for_each function.
Steps to reproduce:
int main(){
}
~~~^~D:\Documenti\Progetto tesi\include/phtree-cpp/phtree/common/filter.h: In instantiation of 'bool improbable::phtree::FilterSphere<CONVERTER, DISTANCE>::IsNodeValid(const KeyInternal&, int) const [with CONVERTER = improbable::phtree::SimplePointConverter<3, double, long long int, improbable::phtree::ScalarConverterIEEE>; DISTANCE = improbable::phtree::DistanceEuclidean<3>; improbable::phtree::FilterSphere<CONVERTER, DISTANCE>::KeyInternal = std::array<long long int, 3>]': D:\Documenti\Progetto tesi\include/phtree-cpp/phtree/v16/for_each.h:56:40: required from 'void improbable::phtree::v16::ForEach<T, CONVERT, CALLBACK_FN, FILTER>::TraverseNode(const KeyInternal&, const NodeT&) [with T = bool; CONVERT = improbable::phtree::SimplePointConverter<3, double, long long int, improbable::phtree::ScalarConverterIEEE>; CALLBACK_FN = main()::Printer; FILTER = improbable::phtree::FilterSphere<improbable::phtree::SimplePointConverter<3, double, long long int, improbable::phtree::ScalarConverterIEEE>, improbable::phtree::DistanceEuclidean<3> >; improbable::phtree::v16::ForEach<T, CONVERT, CALLBACK_FN, FILTER>::KeyInternal = std::array<long long int, 3>; improbable::phtree::v16::ForEach<T, CONVERT, CALLBACK_FN, FILTER>::NodeT = improbable::phtree::v16::Node<3, bool, long long int>]' D:\Documenti\Progetto tesi\include/phtree-cpp/phtree/v16/for_each.h:44:9: required from 'void improbable::phtree::v16::ForEach<T, CONVERT, CALLBACK_FN, FILTER>::run(const EntryT&) [with T = bool; CONVERT = improbable::phtree::SimplePointConverter<3, double, long long int, improbable::phtree::ScalarConverterIEEE>; CALLBACK_FN = main()::Printer; FILTER = improbable::phtree::FilterSphere<improbable::phtree::SimplePointConverter<3, double, long long int, improbable::phtree::ScalarConverterIEEE>, improbable::phtree::DistanceEuclidean<3> >; improbable::phtree::v16::ForEach<T, CONVERT, CALLBACK_FN, FILTER>::EntryT = improbable::phtree::v16::Entry<3, bool, long long int>]' D:\Documenti\Progetto tesi\include/phtree-cpp/phtree/v16/phtree_v16.h:279:83: required from 'void improbable::phtree::v16::PhTreeV16<DIM, T, CONVERT>::for_each(CALLBACK_FN&, FILTER) const [with CALLBACK_FN = main()::Printer; FILTER = improbable::phtree::FilterSphere<improbable::phtree::SimplePointConverter<3, double, long long int, improbable::phtree::ScalarConverterIEEE>, improbable::phtree::DistanceEuclidean<3> >; long long unsigned int DIM = 3; T = bool; CONVERT = improbable::phtree::SimplePointConverter<3, double, long long int, improbable::phtree::ScalarConverterIEEE>]' D:\Documenti\Progetto tesi\include/phtree-cpp/phtree/phtree.h:163:23: required from 'void improbable::phtree::PhTree<DIM, T, CONVERTER>::for_each(CALLBACK_FN&, FILTER) const [with CALLBACK_FN = main()::Printer; FILTER = improbable::phtree::FilterSphere<improbable::phtree::SimplePointConverter<3, double, long long int, improbable::phtree::ScalarConverterIEEE>, improbable::phtree::DistanceEuclidean<3> >; long long unsigned int DIM = 3; T = bool; CONVERTER = improbable::phtree::SimplePointConverter<3, double, long long int, improbable::phtree::ScalarConverterIEEE>]' prova_ph.cpp:34:15: required from here D:\Documenti\Progetto tesi\include/phtree-cpp/phtree/common/filter.h:207:46: error: no matching function for call to 'clamp(const value_type&, improbable::phtree::FilterSphere<improbable::phtree::SimplePointConverter<3, double, long long int, improbable::phtree::ScalarConverterIEEE>, improbable::phtree::DistanceEuclidean<3> >::ScalarInternal&, improbable::phtree::FilterSphere<improbable::phtree::SimplePointConverter<3, double, long long int, improbable::phtree::ScalarConverterIEEE>, improbable::phtree::DistanceEuclidean<3> >::ScalarInternal&)' 207 | closest_in_bounds[i] = std::clamp(centerinternal[i], lo, hi); | constexpr const _Tp& std::clamp(const _Tp&, const _Tp&, const _Tp&)'
3656 | clamp(const _Tp& val, const _Tp& __lo, const _Tp& hi)
| ^~~~~
D:/Programmi/JetBrains/CLion 2022.1.3/bin/mingw/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/bits/stl_algo.h:3656:5: note: template argument deduction/substitution failed:
In file included from D:\Documenti\Progetto tesi\include/phtree-cpp/phtree/common/common.h:24,
from D:\Documenti\Progetto tesi\include/phtree-cpp/phtree/phtree.h:20,
from prova_ph.cpp:2:
D:\Documenti\Progetto tesi\include/phtree-cpp/phtree/common/filter.h:207:46: note: deduced conflicting types for parameter 'const _Tp' ('double' and 'improbable::phtree::FilterSphere<improbable::phtree::SimplePointConverter<3, double, long long int, improbable::phtree::ScalarConverterIEEE>, improbable::phtree::DistanceEuclidean<3> >::ScalarInternal' {aka 'long long int'})
207 | closest_in_bounds[i] = std::clamp(centerinternal[i], lo, hi);
|
~~^~~~~~~~~ In file included from D:/Programmi/JetBrains/CLion 2022.1.3/bin/mingw/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/algorithm:62, from D:\Documenti\Progetto tesi\include/phtree-cpp/phtree/common/base_types.h:20, from D:\Documenti\Progetto tesi\include/phtree-cpp/phtree/common/common.h:20, from D:\Documenti\Progetto tesi\include/phtree-cpp/phtree/phtree.h:20, from prova_ph.cpp:2: D:/Programmi/JetBrains/CLion 2022.1.3/bin/mingw/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/bits/stl_algo.h:3656:5: note: candidate: 'template~~^~~~~~~~~ In file included from D:/Programmi/JetBrains/CLion 2022.1.3/bin/mingw/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/algorithm:62, from D:\Documenti\Progetto tesi\include/phtree-cpp/phtree/phtree.h:20, from prova_ph.cpp:2: D:/Programmi/JetBrains/CLion 2022.1.3/bin/mingw/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/bits/stl_algo.h:3674:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::clamp(const _Tp&, const _Tp&, const _Tp&, _Compare)' 3674 | clamp(const _Tp& val, const _Tp& __lo, const _Tp& hi, _Compare __comp) | ^~~~~ D:/Programmi/JetBrains/CLion 2022.1.3/bin/mingw/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/bits/stl_algo.h:3674:5: note: template argument deduction/substitution failed: In file included from D:\Documenti\Progetto tesi\include/phtree-cpp/phtree/common/common.h:24, from D:\Documenti\Progetto tesi\include/phtree-cpp/phtree/phtree.h:20, from prova_ph.cpp:2: D:\Documenti\Progetto tesi\include/phtree-cpp/phtree/common/filter.h:207:46: note: deduced conflicting types for parameter 'const _Tp' ('double' and 'improbable::phtree::FilterSphere<improbable::phtree::SimplePointConverter<3, double, long long int, improbable::phtree::ScalarConverterIEEE>, improbable::phtree::DistanceEuclidean<3> >::ScalarInternal' {aka 'long long int'}) 207 | closest_in_bounds[i] = std::clamp(centerinternal[i], lo, hi)