Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

about 5 years ago

Language

Compiler

Options

Author

anonymous

about 5 years ago

$
prog.cc:32:69: error: non-type template argument is not a constant expression
        return hana::second(pair) == hana::integral_c<std::uint8_t, frameHeader>;
                                                                    ^~~~~~~~~~~
prog.cc:32:69: note: initializer of 'frameHeader' is not a constant expression
prog.cc:31:46: note: declared here
    auto found = hana::index_if(FramesMap, [&frameHeader = std::as_const(frameHeader)](auto const &pair) {
                                             ^
prog.cc:29:83: warning: unused parameter 'buffer' [-Wunused-parameter]
auto deserializeByFrameHeader(const std::uint8_t frameHeader, const InputIterator buffer)
                                                                                  ^
In file included from prog.cc:1:
In file included from /opt/wandbox/boost-1.73.0/clang-head/include/boost/hana.hpp:59:
In file included from /opt/wandbox/boost-1.73.0/clang-head/include/boost/hana/adapt_adt.hpp:15:
In file included from /opt/wandbox/boost-1.73.0/clang-head/include/boost/hana/detail/struct_macros.hpp:29:
In file included from /opt/wandbox/boost-1.73.0/clang-head/include/boost/hana/tuple.hpp:21:
/opt/wandbox/boost-1.73.0/clang-head/include/boost/hana/detail/index_if.hpp:32:61: error: 'boost::hana::detail::decay<void, void>::type' (aka 'void') is not a class, namespace, or enumeration
                std::declval<Pred>()(std::declval<X1>()))>::type::value)
                                                            ^
/opt/wandbox/boost-1.73.0/clang-head/include/boost/hana/detail/index_if.hpp:51:24: note: in instantiation of template type alias 'f' requested here
            ::template f<Pred, Xs...>;
                       ^
/opt/wandbox/boost-1.73.0/clang-head/include/boost/hana/tuple.hpp:299:33: note: in instantiation of template class 'boost::hana::detail::index_if<(lambda at prog.cc:31:44), boost::hana::pair<boost::hana::type_impl<ConnectFrame>::_, boost::hana::integral_constant<unsigned char, '\x10'>>, boost::hana::pair<boost::hana::type_impl<ConnackFrame>::_, boost::hana::integral_constant<unsigned char, '\x08'>>>' requested here
            -> typename detail::index_if<Pred, Xs...>::type
                                ^
/opt/wandbox/boost-1.73.0/clang-head/include/boost/hana/index_if.hpp:44:25: note: while substituting deduced template arguments into function template 'apply' [with Xs = <boost::hana::pair<boost::hana::type_impl<ConnectFrame>::_, boost::hana::integral_constant<unsigned char, '\x10'>>, boost::hana::pair<boost::hana::type_impl<ConnackFrame>::_, boost::hana::integral_constant<unsigned char, '\x08'>>>, Pred = (lambda at prog.cc:31:44)]
        return IndexIf::apply(static_cast<Xs&&>(xs), static_cast<Pred&&>(pred));
                        ^
prog.cc:31:18: note: in instantiation of function template specialization 'boost::hana::index_if_t::operator()<const boost::hana::tuple<boost::hana::pair<boost::hana::type_impl<ConnectFrame>::_, boost::hana::integral_constant<unsigned char, '\x10'>>, boost::hana::pair<boost::hana::type_impl<ConnackFrame>::_, boost::hana::integral_constant<unsigned char, '\x08'>>> &, (lambda at prog.cc:31:44)>' requested here
    auto found = hana::index_if(FramesMap, [&frameHeader = std::as_const(frameHeader)](auto const &pair) {
                 ^
prog.cc:46:29: note: in instantiation of function template specialization 'deserializeByFrameHeader<std::byte *>' requested here
    ConnackFrame frameOut = deserializeByFrameHeader(header, buffer.begin());
                            ^
In file included from prog.cc:1:
In file included from /opt/wandbox/boost-1.73.0/clang-head/include/boost/hana.hpp:61:
In file included from /opt/wandbox/boost-1.73.0/clang-head/include/boost/hana/adjust.hpp:19:
In file included from /opt/wandbox/boost-1.73.0/clang-head/include/boost/hana/equal.hpp:16:
In file included from /opt/wandbox/boost-1.73.0/clang-head/include/boost/hana/all_of.hpp:15:
In file included from /opt/wandbox/boost-1.73.0/clang-head/include/boost/hana/any_of.hpp:18:
In file included from /opt/wandbox/boost-1.73.0/clang-head/include/boost/hana/concept/searchable.hpp:20:
In file included from /opt/wandbox/boost-1.73.0/clang-head/include/boost/hana/find_if.hpp:26:
/opt/wandbox/boost-1.73.0/clang-head/include/boost/hana/index_if.hpp:44:25: error: no matching member function for call to 'apply'
        return IndexIf::apply(static_cast<Xs&&>(xs), static_cast<Pred&&>(pred));
               ~~~~~~~~~^~~~~
prog.cc:31:18: note: in instantiation of function template specialization 'boost::hana::index_if_t::operator()<const boost::hana::tuple<boost::hana::pair<boost::hana::type_impl<ConnectFrame>::_, boost::hana::integral_constant<unsigned char, '\x10'>>, boost::hana::pair<boost::hana::type_impl<ConnackFrame>::_, boost::hana::integral_constant<unsigned char, '\x08'>>> &, (lambda at prog.cc:31:44)>' requested here
    auto found = hana::index_if(FramesMap, [&frameHeader = std::as_const(frameHeader)](auto const &pair) {
                 ^
prog.cc:46:29: note: in instantiation of function template specialization 'deserializeByFrameHeader<std::byte *>' requested here
    ConnackFrame frameOut = deserializeByFrameHeader(header, buffer.begin());
                            ^
/opt/wandbox/boost-1.73.0/clang-head/include/boost/hana/tuple.hpp:298:31: note: candidate template ignored: substitution failure [with Xs = <boost::hana::pair<boost::hana::type_impl<ConnectFrame>::_, boost::hana::integral_constant<unsigned char, '\x10'>>, boost::hana::pair<boost::hana::type_impl<ConnackFrame>::_, boost::hana::integral_constant<unsigned char, '\x08'>>>, Pred = (lambda at prog.cc:31:44)]
        static constexpr auto apply(tuple<Xs...> const&, Pred const&)
                              ^
prog.cc:46:18: error: no viable conversion from 'int' to 'ConnackFrame'
    ConnackFrame frameOut = deserializeByFrameHeader(header, buffer.begin());
                 ^          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.cc:17:8: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const ConnackFrame &' for 1st argument
struct ConnackFrame
       ^
prog.cc:17:8: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'ConnackFrame &&' for 1st argument
struct ConnackFrame
       ^
1 warning and 4 errors generated.
Exit Code:
1