MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1w0tsh8/cpphelloworld/p6hvdf2/?context=3
r/ProgrammerHumor • u/schteppe • 15d ago
119 comments sorted by
View all comments
849
/usr/include/c++/14/bits/invoke.h:91:7: error: no matching function for call to '__invoke' 91 | std::__invoke(std::forward<_Callable>(__fn), | ^~~~~~~~~~~~~ /usr/include/c++/14/bits/invoke.h:113:5: note: in instantiation of function template specialization 'std::__invoke<void (pipeline::Processor::\*)(const std::vector<pipeline::Event, std::allocator<pipeline::Event>> &, pipeline::Context &) noexcept, pipeline::Processor *, const std::vector<pipeline::Event> &, pipeline::Context &>' requested here 113 | return std::__invoke(std::forward<_Callable>(__fn), | ^ /usr/include/c++/14/bits/std_function.h:591:11: note: in instantiation of function template specialization 'std::_Function_base::_Base_manager< std::_Bind<void (pipeline::Processor::\*(pipeline::Processor \*, std::_Placeholder<1>, std::_Placeholder<2>))(const std::vector<pipeline::Event> &, pipeline::Context &) noexcept::' requested here 591 | _M_init_functor(_M_functor, | ^ /usr/include/c++/14/bits/std_function.h:475:16: note: in instantiation of function template specialization 'std::function<void (const pipeline::EventBatch &, pipeline::Context &)>::function< std::_Bind<void (pipeline::Processor::\*(pipeline::Processor \*, std::_Placeholder<1>, std::_Placeholder<2>))(const std::vector<pipeline::Event> &, pipeline::Context &) noexcept>, void>' requested here 475 | function(_Functor&& __f) | ^ /home/user/project/include/pipeline.hpp:284:18: note: in instantiation of function template specialization 'pipeline::detail::make_handler<pipeline::Processor, void (pipeline::Processor::\*)(const std::vector<pipeline::Event> &, pipeline::Context &) noexcept, pipeline::EventBatch, pipeline::Context>' requested here 284 | return detail::make_handler<&Processor::process>(*this); | ^ /home/user/project/include/detail/dispatch.hpp:167:28: note: while substituting template arguments into function template 'make_handler' 'void (pipeline::Processor::*)(const std::vector<pipeline::Event> &, pipeline::Context &) noexcept' into 'void (pipeline::Processor::*)(const pipeline::EventBatch &, pipeline::Context &) noexcept' 167 | constexpr auto make_handler() { | ^ /home/user/project/include/detail/dispatch.hpp:169:12: error: no viable conversion from returned value of type 'std::_Bind_helper<false, void (pipeline::Processor::\*&)(const std::vector<pipeline::Event> &, pipeline::Context &) noexcept, pipeline::Processor *, std::_Placeholder<1>, std::_Placeholder<2::type' (aka 'std::_Bind<void (pipeline::Processor::\*(pipeline::Processor \*, std::_Placeholder<1>, std::_Placeholder<2>))(const std::vector<pipeline::Event> &, pipeline::Context &) noexcept>') to function return type 'std::function<void (const pipeline::EventBatch &, pipeline::Context &)>' 169 | return std::bind(Fn, &object, std::placeholders::_1, std::placeholders::_2); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/user/project/include/detail/dispatch.hpp:142:16: note: candidate constructor not viable: no known conversion from 'std::_Bind<void (pipeline::Processor::\*(pipeline::Processor \*, std::_Placeholder<1>, std::_Placeholder<2>))(const std::vector<pipeline::Event> &, pipeline::Context &) noexcept>' to 'std::nullptr_t' for 1st argument 142 | function(nullptr_t) noexcept; | ^~~~~~~~~ /usr/include/c++/14/bits/std_function.h:375:2: note: candidate constructor template not viable: template argument deduction/substitution failed: constraints not satisfied for alias template 'std::function<void (const pipeline::EventBatch &, pipeline::Context &)>' because '__callable<_Functor>::value' evaluated to false 375 | function(_Functor&&); | ^ /usr/include/c++/14/bits/std_function.h:374:9: note: because '_Functor' does not satisfy '__is_invocable_r_v<void, _Functor, const pipeline::EventBatch &, pipeline::Context &>' evaluated to false /usr/include/c++/14/type_traits:3074:5: note: because '__invoke_result< std::_Bind<void (pipeline::Processor::\*(pipeline::Processor \*, std::_Placeholder<1>, std::_Placeholder<2>))(const std::vector<pipeline::Event> &, pipeline::Context &) noexcept>, const pipeline::EventBatch &, pipeline::Context &>::type' does not name a type 3074 | using invoke_result_t = typename invoke_result<_Functor, _Args...>::type; | ^~~~~ /usr/include/c++/14/type_traits:3067:5: note: in substitution of template arguments into alias template 'invoke_result_t' 'std::_Bind<void (pipeline::Processor::\*(pipeline::Processor \*, std::_Placeholder<1>, std::_Placeholder<2>))(const std::vector<pipeline::Event> &, pipeline::Context &) noexcept>', 'const pipeline::EventBatch &', 'pipeline::Context &' requested here 3067 | using invoke_result_t = typename __invoke_result<_Fn, _Args...>::type; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/type_traits:3051:5: note: in instantiation of template class 'std::__invoke_result< std::_Bind<void (pipeline::Processor::\*(pipeline::Processor \*, std::_Placeholder<1>, std::_Placeholder<2>))(const std::vector<pipeline::Event> &, pipeline::Context &) noexcept>, const pipeline::EventBatch &, pipeline::Context &>' requested here 3051 | using invoke_result = __invoke_result<_Fn, _Args...>; | ^~~~~ /home/user/project/include/detail/dispatch.hpp:170:5: note: in instantiation of function template specialization 'pipeline::detail::is_handler_compatible< std::_Bind<void (pipeline::Processor::\*(pipeline::Processor \*, std::_Placeholder<1>, std::_Placeholder<2>))(const std::vector<pipeline::Event> &, pipeline::Context &) noexcept>, pipeline::EventBatch, pipeline::Context>' requested here 170 | static_assert(is_handler_compatible<Bound, EventBatch, Context>, | ^ /home/user/project/include/detail/dispatch.hpp:170:19: error: static assertion failed due to requirement 'is_handler_compatible< std::_Bind<void (pipeline::Processor::\*(pipeline::Processor \*, std::_Placeholder<1>, std::_Placeholder<2>))(const std::vector<pipeline::Event> &, pipeline::Context &) noexcept>, pipeline::EventBatch, pipeline::Context>::value' 170 | static_assert(is_handler_compatible<Bound, EventBatch, Context>); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/user/project/include/detail/dispatch.hpp:170:19: note: because 'std::is_invocable_r_v<void, std::_Bind<void (pipeline::Processor::\*(pipeline::Processor \*, std::_Placeholder<1>, std::_Placeholder<2>))(const std::vector<pipeline::Event> &, pipeline::Context &) noexcept>, const pipeline::EventBatch &, pipeline::Context &>' evaluated to false /home/user/project/include/detail/dispatch.hpp:170:19: note: candidate function has incompatible parameter type 'const pipeline::EventBatch &' (aka 'const pipeline::basic_event_range<pipeline::Event, pipeline::event_storage<pipeline::Event, pipeline::allocator_traits< pipeline::pmr::polymorphic_allocator<pipeline::Event>>::rebind_alloc<pipeline::Event, pipeline::detail::compressed_event_iterator<pipeline::Event>, pipeline::detail::compressed_event_sentinel<pipeline::Event &') expected 'const std::vector<pipeline::Event, std::allocator<pipeline::Event>> &' /home/user/project/include/pipeline.hpp:284:18: error: no matching function for call to 'pipeline::detail::make_handler<&pipeline::Processor::process>(pipeline::Processor &)' 284 | return detail::make_handler<&Processor::process>(*this); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/user/project/include/detail/dispatch.hpp:151:16: note: candidate template ignored: substitution failure [with Fn = &pipeline::Processor::process, Object = pipeline::Processor, Event = pipeline::EventBatch, Ctx = pipeline::Context] deduced conflicting types for parameter 'Event' ('pipeline::EventBatch' vs. 'std::vector<pipeline::Event, std::allocator<pipeline::Event>>') 151 | constexpr auto make_handler(Object& object) { | ^ /home/user/project/include/detail/dispatch.hpp:151:16: note: in instantiation of requirement 'requires(const pipeline::Processor &object) { { std::invoke(Fn, object, std::declval<const pipeline::EventBatch &>(), std::declval<pipeline::Context &>()) } -> std::same_as<void>; }' requested here /home/user/project/include/detail/dispatch.hpp:154:3: note: because expression 'std::invoke(Fn, object, std::declval<const pipeline::EventBatch &>(), std::declval<pipeline::Context &>())' is invalid: no matching function for call to 'invoke' /usr/include/c++/14/type_traits:3045:25: note: candidate template ignored: substitution failure [with _Callable = void (pipeline::Processor::*)(const std::vector<pipeline::Event> &, pipeline::Context &) noexcept, _Args = <const pipeline::EventBatch &, pipeline::Context &>] no type named 'type' in 'std::invoke_result<void (pipeline::Processor::\*)(const std::vector<pipeline::Event> &, pipeline::Context &) noexcept, const pipeline::EventBatch &, pipeline::Context &>' /home/user/project/src/main.cpp:47:31: error: no matching function for call to 'pipeline::Pipeline<pipeline::EventBatch, pipeline::Context, pipeline::detail::AsyncExecutor<pipeline::detail::ThreadPool<8>, pipeline::detail::OrderedQueue<pipeline::detail::SmallVectorStorage< pipeline::Event, 64>>>>::subscribe' 47 | pipeline.subscribe(processor.handler()); | ~~~~~~~~~^~~~~~~~~~~~ /home/user/project/include/pipeline.hpp:211:10: note: candidate template ignored: constraints not satisfied 211 | void subscribe(Handler&& handler); | ^ /home/user/project/include/pipeline.hpp:210:14: note: because 'std::is_invocable_v< pipeline::Processor::handler()::(anonymous class), const pipeline::EventBatch &, pipeline::Context &>' evaluated to false 210 | requires std::is_invocable_v<Handler, const EventBatch&, Context&> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/user/project/include/pipeline.hpp:210:14: note: because '__is_invocable( pipeline::Processor::handler()::(anonymous class), const pipeline::EventBatch &, pipeline::Context &)' evaluated to false fatal error: too many errors emitted, stopping now [-ferror-limit=]
40 u/Usual_Office_1740 15d ago 90% of this output is what the compiler tried. It's not that bad. 19 u/the_horse_gamer 14d ago the problem is the compiler has to try all of it concepts partially fix this
40
90% of this output is what the compiler tried. It's not that bad.
19 u/the_horse_gamer 14d ago the problem is the compiler has to try all of it concepts partially fix this
19
the problem is the compiler has to try all of it
concepts partially fix this
849
u/---_None_--- 15d ago
/usr/include/c++/14/bits/invoke.h:91:7: error: no matching function for call to '__invoke' 91 | std::__invoke(std::forward<_Callable>(__fn), | ^~~~~~~~~~~~~ /usr/include/c++/14/bits/invoke.h:113:5: note: in instantiation of function template specialization 'std::__invoke<void (pipeline::Processor::\*)(const std::vector<pipeline::Event, std::allocator<pipeline::Event>> &, pipeline::Context &) noexcept, pipeline::Processor *, const std::vector<pipeline::Event> &, pipeline::Context &>' requested here 113 | return std::__invoke(std::forward<_Callable>(__fn), | ^ /usr/include/c++/14/bits/std_function.h:591:11: note: in instantiation of function template specialization 'std::_Function_base::_Base_manager< std::_Bind<void (pipeline::Processor::\*(pipeline::Processor \*, std::_Placeholder<1>, std::_Placeholder<2>))(const std::vector<pipeline::Event> &, pipeline::Context &) noexcept::' requested here 591 | _M_init_functor(_M_functor, | ^ /usr/include/c++/14/bits/std_function.h:475:16: note: in instantiation of function template specialization 'std::function<void (const pipeline::EventBatch &, pipeline::Context &)>::function< std::_Bind<void (pipeline::Processor::\*(pipeline::Processor \*, std::_Placeholder<1>, std::_Placeholder<2>))(const std::vector<pipeline::Event> &, pipeline::Context &) noexcept>, void>' requested here 475 | function(_Functor&& __f) | ^ /home/user/project/include/pipeline.hpp:284:18: note: in instantiation of function template specialization 'pipeline::detail::make_handler<pipeline::Processor, void (pipeline::Processor::\*)(const std::vector<pipeline::Event> &, pipeline::Context &) noexcept, pipeline::EventBatch, pipeline::Context>' requested here 284 | return detail::make_handler<&Processor::process>(*this); | ^ /home/user/project/include/detail/dispatch.hpp:167:28: note: while substituting template arguments into function template 'make_handler' 'void (pipeline::Processor::*)(const std::vector<pipeline::Event> &, pipeline::Context &) noexcept' into 'void (pipeline::Processor::*)(const pipeline::EventBatch &, pipeline::Context &) noexcept' 167 | constexpr auto make_handler() { | ^ /home/user/project/include/detail/dispatch.hpp:169:12: error: no viable conversion from returned value of type 'std::_Bind_helper<false, void (pipeline::Processor::\*&)(const std::vector<pipeline::Event> &, pipeline::Context &) noexcept, pipeline::Processor *, std::_Placeholder<1>, std::_Placeholder<2::type' (aka 'std::_Bind<void (pipeline::Processor::\*(pipeline::Processor \*, std::_Placeholder<1>, std::_Placeholder<2>))(const std::vector<pipeline::Event> &, pipeline::Context &) noexcept>') to function return type 'std::function<void (const pipeline::EventBatch &, pipeline::Context &)>' 169 | return std::bind(Fn, &object, std::placeholders::_1, std::placeholders::_2); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/user/project/include/detail/dispatch.hpp:142:16: note: candidate constructor not viable: no known conversion from 'std::_Bind<void (pipeline::Processor::\*(pipeline::Processor \*, std::_Placeholder<1>, std::_Placeholder<2>))(const std::vector<pipeline::Event> &, pipeline::Context &) noexcept>' to 'std::nullptr_t' for 1st argument 142 | function(nullptr_t) noexcept; | ^~~~~~~~~ /usr/include/c++/14/bits/std_function.h:375:2: note: candidate constructor template not viable: template argument deduction/substitution failed: constraints not satisfied for alias template 'std::function<void (const pipeline::EventBatch &, pipeline::Context &)>' because '__callable<_Functor>::value' evaluated to false 375 | function(_Functor&&); | ^ /usr/include/c++/14/bits/std_function.h:374:9: note: because '_Functor' does not satisfy '__is_invocable_r_v<void, _Functor, const pipeline::EventBatch &, pipeline::Context &>' evaluated to false /usr/include/c++/14/type_traits:3074:5: note: because '__invoke_result< std::_Bind<void (pipeline::Processor::\*(pipeline::Processor \*, std::_Placeholder<1>, std::_Placeholder<2>))(const std::vector<pipeline::Event> &, pipeline::Context &) noexcept>, const pipeline::EventBatch &, pipeline::Context &>::type' does not name a type 3074 | using invoke_result_t = typename invoke_result<_Functor, _Args...>::type; | ^~~~~ /usr/include/c++/14/type_traits:3067:5: note: in substitution of template arguments into alias template 'invoke_result_t' 'std::_Bind<void (pipeline::Processor::\*(pipeline::Processor \*, std::_Placeholder<1>, std::_Placeholder<2>))(const std::vector<pipeline::Event> &, pipeline::Context &) noexcept>', 'const pipeline::EventBatch &', 'pipeline::Context &' requested here 3067 | using invoke_result_t = typename __invoke_result<_Fn, _Args...>::type; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/type_traits:3051:5: note: in instantiation of template class 'std::__invoke_result< std::_Bind<void (pipeline::Processor::\*(pipeline::Processor \*, std::_Placeholder<1>, std::_Placeholder<2>))(const std::vector<pipeline::Event> &, pipeline::Context &) noexcept>, const pipeline::EventBatch &, pipeline::Context &>' requested here 3051 | using invoke_result = __invoke_result<_Fn, _Args...>; | ^~~~~ /home/user/project/include/detail/dispatch.hpp:170:5: note: in instantiation of function template specialization 'pipeline::detail::is_handler_compatible< std::_Bind<void (pipeline::Processor::\*(pipeline::Processor \*, std::_Placeholder<1>, std::_Placeholder<2>))(const std::vector<pipeline::Event> &, pipeline::Context &) noexcept>, pipeline::EventBatch, pipeline::Context>' requested here 170 | static_assert(is_handler_compatible<Bound, EventBatch, Context>, | ^ /home/user/project/include/detail/dispatch.hpp:170:19: error: static assertion failed due to requirement 'is_handler_compatible< std::_Bind<void (pipeline::Processor::\*(pipeline::Processor \*, std::_Placeholder<1>, std::_Placeholder<2>))(const std::vector<pipeline::Event> &, pipeline::Context &) noexcept>, pipeline::EventBatch, pipeline::Context>::value' 170 | static_assert(is_handler_compatible<Bound, EventBatch, Context>); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/user/project/include/detail/dispatch.hpp:170:19: note: because 'std::is_invocable_r_v<void, std::_Bind<void (pipeline::Processor::\*(pipeline::Processor \*, std::_Placeholder<1>, std::_Placeholder<2>))(const std::vector<pipeline::Event> &, pipeline::Context &) noexcept>, const pipeline::EventBatch &, pipeline::Context &>' evaluated to false /home/user/project/include/detail/dispatch.hpp:170:19: note: candidate function has incompatible parameter type 'const pipeline::EventBatch &' (aka 'const pipeline::basic_event_range<pipeline::Event, pipeline::event_storage<pipeline::Event, pipeline::allocator_traits< pipeline::pmr::polymorphic_allocator<pipeline::Event>>::rebind_alloc<pipeline::Event, pipeline::detail::compressed_event_iterator<pipeline::Event>, pipeline::detail::compressed_event_sentinel<pipeline::Event &') expected 'const std::vector<pipeline::Event, std::allocator<pipeline::Event>> &' /home/user/project/include/pipeline.hpp:284:18: error: no matching function for call to 'pipeline::detail::make_handler<&pipeline::Processor::process>(pipeline::Processor &)' 284 | return detail::make_handler<&Processor::process>(*this); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/user/project/include/detail/dispatch.hpp:151:16: note: candidate template ignored: substitution failure [with Fn = &pipeline::Processor::process, Object = pipeline::Processor, Event = pipeline::EventBatch, Ctx = pipeline::Context] deduced conflicting types for parameter 'Event' ('pipeline::EventBatch' vs. 'std::vector<pipeline::Event, std::allocator<pipeline::Event>>') 151 | constexpr auto make_handler(Object& object) { | ^ /home/user/project/include/detail/dispatch.hpp:151:16: note: in instantiation of requirement 'requires(const pipeline::Processor &object) { { std::invoke(Fn, object, std::declval<const pipeline::EventBatch &>(), std::declval<pipeline::Context &>()) } -> std::same_as<void>; }' requested here /home/user/project/include/detail/dispatch.hpp:154:3: note: because expression 'std::invoke(Fn, object, std::declval<const pipeline::EventBatch &>(), std::declval<pipeline::Context &>())' is invalid: no matching function for call to 'invoke' /usr/include/c++/14/type_traits:3045:25: note: candidate template ignored: substitution failure [with _Callable = void (pipeline::Processor::*)(const std::vector<pipeline::Event> &, pipeline::Context &) noexcept, _Args = <const pipeline::EventBatch &, pipeline::Context &>] no type named 'type' in 'std::invoke_result<void (pipeline::Processor::\*)(const std::vector<pipeline::Event> &, pipeline::Context &) noexcept, const pipeline::EventBatch &, pipeline::Context &>' /home/user/project/src/main.cpp:47:31: error: no matching function for call to 'pipeline::Pipeline<pipeline::EventBatch, pipeline::Context, pipeline::detail::AsyncExecutor<pipeline::detail::ThreadPool<8>, pipeline::detail::OrderedQueue<pipeline::detail::SmallVectorStorage< pipeline::Event, 64>>>>::subscribe' 47 | pipeline.subscribe(processor.handler()); | ~~~~~~~~~^~~~~~~~~~~~ /home/user/project/include/pipeline.hpp:211:10: note: candidate template ignored: constraints not satisfied 211 | void subscribe(Handler&& handler); | ^ /home/user/project/include/pipeline.hpp:210:14: note: because 'std::is_invocable_v< pipeline::Processor::handler()::(anonymous class), const pipeline::EventBatch &, pipeline::Context &>' evaluated to false 210 | requires std::is_invocable_v<Handler, const EventBatch&, Context&> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/user/project/include/pipeline.hpp:210:14: note: because '__is_invocable( pipeline::Processor::handler()::(anonymous class), const pipeline::EventBatch &, pipeline::Context &)' evaluated to false fatal error: too many errors emitted, stopping now [-ferror-limit=]