You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the following code that compiles with GCC/Clang but produces compilation error on MSVC (Microsoft (R) C/C++ Optimizing Compiler Version 19.43.34809 for x64):
18> see declaration of 'B5::Terrain::loop_event::<lambda_8>'
18> C:\Users\Adi\AppData\Local\CPM_SOURCE_CACHE\cpp-lazy\cc4f387d43c3d23ab158939607e6ab5afcbbfa1e\include\Lz\detail\FunctionContainer.hpp(17,86):
18> the template instantiation context (the oldest one first) is
18> C:\projects\c_c_plus_plus\xray-ng\src\samples\vulkan\code\terrain.cc(873,14):
18> see reference to class template instantiation 'lz::IterView<lz::detail::FilterIterator<Iterator,B5::Terrain::loop_event::<lambda_8>,std::execution::sequenced_policy>>' being compiled
18> with
18> [
18> Iterator=std::_List_const_iterator<std::_List_val<std::_List_simple_types<xray::math::scalar2<int32_t>>>>
18> ]
18> C:\Users\Adi\AppData\Local\CPM_SOURCE_CACHE\cpp-lazy\cc4f387d43c3d23ab158939607e6ab5afcbbfa1e\include\Lz\Lz.hpp(90,39):
18> see reference to class template instantiation 'lz::detail::BasicIteratorView<Iterator>' being compiled
18> with
18> [
18> Iterator=lz::detail::FilterIterator<std::_List_const_iterator<std::_List_val<std::_List_simple_types<xray::math::scalar2<int32_t>>>>,B5::Terrain::loop_event::<lambda_8>,std::execution::sequenced_policy>
18> ]
18> C:\Users\Adi\AppData\Local\CPM_SOURCE_CACHE\cpp-lazy\cc4f387d43c3d23ab158939607e6ab5afcbbfa1e\include\Lz\detail\BasicIteratorView.hpp(226,8):
18> see reference to class template instantiation 'lz::detail::FilterIterator<Iterator,B5::Terrain::loop_event::<lambda_8>,std::execution::sequenced_policy>' being compiled
18> with
18> [
18> Iterator=std::_List_const_iterator<std::_List_val<std::_List_simple_types<xray::math::scalar2<int32_t>>>>
18> ]
18> C:\Users\Adi\AppData\Local\CPM_SOURCE_CACHE\cpp-lazy\cc4f387d43c3d23ab158939607e6ab5afcbbfa1e\include\Lz\detail\iterators\FilterIterator.hpp(55,47):
18> see reference to class template instantiation 'lz::detail::FunctionContainer<UnaryPredicate>' being compiled
18> with
18> [
18> UnaryPredicate=B5::Terrain::loop_event::<lambda_8>
18> ]
18> C:\Users\Adi\AppData\Local\CPM_SOURCE_CACHE\cpp-lazy\cc4f387d43c3d23ab158939607e6ab5afcbbfa1e\include\Lz\detail\FunctionContainer.hpp(17,5):
18> while compiling class template member function 'lz::detail::FunctionContainer<UnaryPredicate>::FunctionContainer(std::false_type)'
18> with
18> [
18> UnaryPredicate=B5::Terrain::loop_event::<lambda_8>
18> ]
18> C:\Users\Adi\AppData\Local\CPM_SOURCE_CACHE\cpp-lazy\cc4f387d43c3d23ab158939607e6ab5afcbbfa1e\include\Lz\detail\FunctionContainer.hpp(91,54):
18> see the first reference to 'lz::detail::FunctionContainer<UnaryPredicate>::FunctionContainer' in 'lz::detail::FunctionContainer<UnaryPredicate>::FunctionContainer'
18> with
18> [
18> UnaryPredicate=B5::Terrain::loop_event::<lambda_8>
18> ]
18> C:\Users\Adi\AppData\Local\CPM_SOURCE_CACHE\cpp-lazy\cc4f387d43c3d23ab158939607e6ab5afcbbfa1e\include\Lz\detail\iterators\FilterIterator.hpp(55,57):
18> see the first reference to 'lz::detail::FunctionContainer<UnaryPredicate>::FunctionContainer' in 'lz::detail::FilterIterator<Iterator,B5::Terrain::loop_event::<lambda_8>,std::execution::sequenced_policy>::FilterIterator'
18> with
18> [
18> UnaryPredicate=B5::Terrain::loop_event::<lambda_8>
18> ]
18> and
18> [
18> Iterator=std::_List_const_iterator<std::_List_val<std::_List_simple_types<xray::math::scalar2<int32_t>>>>
18> ]
18>C:\Users\Adi\AppData\Local\CPM_SOURCE_CACHE\cpp-lazy\cc4f387d43c3d23ab158939607e6ab5afcbbfa1e\include\Lz\detail\FunctionContainer.hpp(18,42): error C2338: static_assert failed: 'Please use std::function instead of a lambda in this case, because lambda's are not default constructible pre C++20'
The text was updated successfully, but these errors were encountered:
Hi, thanks for reaching out and thanks for the issue. Currently, the dev branch is under heavy maintenance and performance improvements & revisioning the library. So I guess you could do the following things while I work on a fix for this on the master branch (which will be replaced by the dev branch within now and 1 or 2 months or so):
use std::function for now as a workaround
use the dev branch which is still under heavy development but 80/90% is done, include Lz/filter.hpp and use the following code (this is an approximation)
I have the following code that compiles with GCC/Clang but produces compilation error on MSVC (Microsoft (R) C/C++ Optimizing Compiler Version 19.43.34809 for x64):
The errors:
The text was updated successfully, but these errors were encountered: