Author
anonymous
over 3 years ago
Language
C++
Compiler
gcc HEAD 12.0.0 20210721 (experimental)
Options
Warnings
Boost 1.73.0
C++2b(GNU)
no pedantic
Author
anonymous
over 3 years ago
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/gcc-head/include -std=gnu++2b
prog.cc: In function 'int main()':
prog.cc:77:32: error: no match for call to '(perfect_forwarded_t<main()::<lambda(double, double)>, double>) (double)'
77 | std::cout << affine_transform(3.0) << std::endl; // error!
| ~~~~~~~~~~~~~~~~^~~~~
prog.cc:29:20: note: candidate: 'template<class ... Args, class> constexpr decltype (Op()((get<Idx>)(((__perfect_forward_impl<Op, std::integer_sequence<long unsigned int, Idx ...>, Bound ...>*)this)->__perfect_forward_impl<Op, std::integer_sequence<long unsigned int, Idx ...>, Bound ...>::bound_)..., (forward<Args>)(__perfect_forward_impl<Op, std::integer_sequence<long unsigned int, Idx ...>, Bound ...>::operator()::args)...)) __perfect_forward_impl<Op, std::integer_sequence<long unsigned int, Idx ...>, Bound ...>::operator()(Args&& ...) & [with Args = {Args ...}; Op = main()::<lambda(double, double)>; long unsigned int ...Idx = {0}; Bound = {double}]'
29 | constexpr auto operator()(Args&&... args) &
| ^~~~~~~~
prog.cc:29:20: note: template argument deduction/substitution failed:
prog.cc: In substitution of 'template<class ... Args, class> constexpr decltype (main()::<lambda(double, double)>()(get<0>(((__perfect_forward_impl<main()::<lambda(double, double)>, std::integer_sequence<long unsigned int, 0>, double>*)this)->__perfect_forward_impl<main()::<lambda(double, double)>, std::integer_sequence<long unsigned int, 0>, double>::bound_), (forward<Args>)(__perfect_forward_impl<Op, std::integer_sequence<long unsigned int, Idx ...>, Bound ...>::operator()::args)...)) __perfect_forward_impl<main()::<lambda(double, double)>, std::integer_sequence<long unsigned int, 0>, double>::operator()(Args&& ...) & [with Args = {double}; <template-parameter-1-2> = void]':
prog.cc:77:32: required from here
prog.cc:31:27: error: use of deleted function 'main()::<lambda(double, double)>::<lambda>()'
31 | -> decltype( Op()(std::get<Idx>(bound_)..., std::forward<Args>(args)...))
| ^~~~
prog.cc:75:48: note: a lambda closure type has a deleted default constructor
75 | using affine_transform_op = decltype([b = 1.0](double a, double x) { return a * x + b; });
| ^
prog.cc:35:10: note: candidate: 'template<class ... Args, class> auto __perfect_forward_impl<Op, std::integer_sequence<long unsigned int, Idx ...>, Bound ...>::operator()(Args&& ...) & [with Args = {Args ...}; Op = main()::<lambda(double, double)>; long unsigned int ...Idx = {0}; Bound = {double}]' (deleted)
35 | auto operator()(Args&&...) & = delete;
| ^~~~~~~~
prog.cc:35:10: note: template argument deduction/substitution failed:
In file included from /opt/wandbox/gcc-head/include/c++/12.0.0/bits/move.h:57,
from /opt/wandbox/gcc-head/include/c++/12.0.0/bits/nested_exception.h:40,
from /opt/wandbox/gcc-head/include/c++/12.0.0/exception:154,
from /opt/wandbox/gcc-head/include/c++/12.0.0/ios:39,
from /opt/wandbox/gcc-head/include/c++/12.0.0/ostream:38,
from /opt/wandbox/gcc-head/include/c++/12.0.0/iostream:39,
from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/12.0.0/type_traits: In substitution of 'template<bool _Cond, class _Tp> using enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]':
prog.cc:34:30: required from here
/opt/wandbox/gcc-head/include/c++/12.0.0/type_traits:2603:11: error: no type named 'type' in 'struct std::enable_if<false, void>'
2603 | using enable_if_t = typename enable_if<_Cond, _Tp>::type;
| ^~~~~~~~~~~
prog.cc:38:20: note: candidate: 'template<class ... Args, class> constexpr decltype (Op()((get<Idx>)(((const __perfect_forward_impl<Op, std::integer_sequence<long unsigned int, Idx ...>, Bound ...>*)this)->__perfect_forward_impl<Op, std::integer_sequence<long unsigned int, Idx ...>, Bound ...>::bound_)..., (forward<Args>)(__perfect_forward_impl<Op, std::integer_sequence<long unsigned int, Idx ...>, Bound ...>::operator()::args)...)) __perfect_forward_impl<Op, std::integer_sequence<long unsigned int, Idx ...>, Bound ...>::operator()(Args&& ...) const & [with Args = {Args ...}; Op = main()::<lambda(double, double)>; long unsigned int ...Idx = {0}; Bound = {double}]'
38 | constexpr auto operator()(Args&&... args) const&
| ^~~~~~~~
prog.cc:38:20: note: template argument deduction/substitution failed:
prog.cc: In substitution of 'template<class ... Args, class> constexpr decltype (main()::<lambda(double, double)>()(get<0>(((const __perfect_forward_impl<main()::<lambda(double, double)>, std::integer_sequence<long unsigned int, 0>, double>*)this)->__perfect_forward_impl<main()::<lambda(double, double)>, std::integer_sequence<long unsigned int, 0>, double>::bound_), (forward<Args>)(__perfect_forward_impl<Op, std::integer_sequence<long unsigned int, Idx ...>, Bound ...>::operator()::args)...)) __perfect_forward_impl<main()::<lambda(double, double)>, std::integer_sequence<long unsigned int, 0>, double>::operator()(Args&& ...) const & [with Args = {double}; <template-parameter-1-2> = void]':
prog.cc:77:32: required from here
prog.cc:40:27: error: use of deleted function 'main()::<lambda(double, double)>::<lambda>()'
40 | -> decltype( Op()(std::get<Idx>(bound_)..., std::forward<Args>(args)...))
| ^~~~
prog.cc:44:10: note: candidate: 'template<class ... Args, class> auto __perfect_forward_impl<Op, std::integer_sequence<long unsigned int, Idx ...>, Bound ...>::operator()(Args&& ...) const & [with Args = {Args ...}; Op = main()::<lambda(double, double)>; long unsigned int ...Idx = {0}; Bound = {double}]' (deleted)
44 | auto operator()(Args&&...) const& = delete;
| ^~~~~~~~
prog.cc:44:10: note: template argument deduction/substitution failed:
prog.cc:47:20: note: candidate: 'template<class ... Args, class> constexpr decltype (Op()((get<Idx>)(std::move(((__perfect_forward_impl<Op, std::integer_sequence<long unsigned int, Idx ...>, Bound ...>*)this)->__perfect_forward_impl<Op, std::integer_sequence<long unsigned int, Idx ...>, Bound ...>::bound_))..., (forward<Args>)(__perfect_forward_impl<Op, std::integer_sequence<long unsigned int, Idx ...>, Bound ...>::operator()::args)...)) __perfect_forward_impl<Op, std::integer_sequence<long unsigned int, Idx ...>, Bound ...>::operator()(Args&& ...) && [with Args = {Args ...}; Op = main()::<lambda(double, double)>; long unsigned int ...Idx = {0}; Bound = {double}]'
47 | constexpr auto operator()(Args&&... args) &&
| ^~~~~~~~
prog.cc:47:20: note: template argument deduction/substitution failed:
prog.cc: In substitution of 'template<class ... Args, class> constexpr decltype (main()::<lambda(double, double)>()(get<0>(std::move(((__perfect_forward_impl<main()::<lambda(double, double)>, std::integer_sequence<long unsigned int, 0>, double>*)this)->__perfect_forward_impl<main()::<lambda(double, double)>, std::integer_sequence<long unsigned int, 0>, double>::bound_)), (forward<Args>)(__perfect_forward_impl<Op, std::integer_sequence<long unsigned int, Idx ...>, Bound ...>::operator()::args)...)) __perfect_forward_impl<main()::<lambda(double, double)>, std::integer_sequence<long unsigned int, 0>, double>::operator()(Args&& ...) && [with Args = {double}; <template-parameter-1-2> = void]':
prog.cc:77:32: required from here
prog.cc:49:27: error: use of deleted function 'main()::<lambda(double, double)>::<lambda>()'
49 | -> decltype( Op()(std::get<Idx>(std::move(bound_))..., std::forward<Args>(args)...))
| ^~~~
prog.cc:53:10: note: candidate: 'template<class ... Args, class> auto __perfect_forward_impl<Op, std::integer_sequence<long unsigned int, Idx ...>, Bound ...>::operator()(Args&& ...) && [with Args = {Args ...}; Op = main()::<lambda(double, double)>; long unsigned int ...Idx = {0}; Bound = {double}]' (deleted)
53 | auto operator()(Args&&...) && = delete;
| ^~~~~~~~
prog.cc:53:10: note: template argument deduction/substitution failed:
prog.cc:56:20: note: candidate: 'template<class ... Args, class> constexpr decltype (Op()((get<Idx>)(std::move(((const __perfect_forward_impl<Op, std::integer_sequence<long unsigned int, Idx ...>, Bound ...>*)this)->__perfect_forward_impl<Op, std::integer_sequence<long unsigned int, Idx ...>, Bound ...>::bound_))..., (forward<Args>)(__perfect_forward_impl<Op, std::integer_sequence<long unsigned int, Idx ...>, Bound ...>::operator()::args)...)) __perfect_forward_impl<Op, std::integer_sequence<long unsigned int, Idx ...>, Bound ...>::operator()(Args&& ...) const && [with Args = {Args ...}; Op = main()::<lambda(double, double)>; long unsigned int ...Idx = {0}; Bound = {double}]'
56 | constexpr auto operator()(Args&&... args) const&&
| ^~~~~~~~
prog.cc:56:20: note: template argument deduction/substitution failed:
prog.cc: In substitution of 'template<class ... Args, class> constexpr decltype (main()::<lambda(double, double)>()(get<0>(std::move(((const __perfect_forward_impl<main()::<lambda(double, double)>, std::integer_sequence<long unsigned int, 0>, double>*)this)->__perfect_forward_impl<main()::<lambda(double, double)>, std::integer_sequence<long unsigned int, 0>, double>::bound_)), (forward<Args>)(__perfect_forward_impl<Op, std::integer_sequence<long unsigned int, Idx ...>, Bound ...>::operator()::args)...)) __perfect_forward_impl<main()::<lambda(double, double)>, std::integer_sequence<long unsigned int, 0>, double>::operator()(Args&& ...) const && [with Args = {double}; <template-parameter-1-2> = void]':
prog.cc:77:32: required from here
prog.cc:58:27: error: use of deleted function 'main()::<lambda(double, double)>::<lambda>()'
58 | -> decltype( Op()(std::get<Idx>(std::move(bound_))..., std::forward<Args>(args)...))
| ^~~~
prog.cc:62:10: note: candidate: 'template<class ... Args, class> auto __perfect_forward_impl<Op, std::integer_sequence<long unsigned int, Idx ...>, Bound ...>::operator()(Args&& ...) const && [with Args = {Args ...}; Op = main()::<lambda(double, double)>; long unsigned int ...Idx = {0}; Bound = {double}]' (deleted)
62 | auto operator()(Args&&...) const&& = delete;
| ^~~~~~~~
prog.cc:62:10: note: template argument deduction/substitution failed:
Exit Code:
1