Hello,
I would like to report an error during the compilation of a code that uses the beast component of Boost (v1.71.0).
Basically, I obtain the following error when I call the function boost::beast::http::read :
H:/3rdParty_lib/Boost/boost_1_71_0/boost/beast/http/message.hpp(265): error: static assertion failed with "Fields type requirements not met" static_assert(is_fields<Fields>::value, ^ detected during: instantiation of class "boost::beast::http::header<0, Fields> [with Fields=boost::beast::http::fields]" at line 495 instantiation of class "boost::beast::http::message<isRequest, Body, Fields> [with isRequest=0, Body=boost::beast::http::string_body, Fields=boost::beast::http::fields]" at line 22 of "H:/TestIntelBoost/main.cpp" H:/3rdParty_lib/Boost/boost_1_71_0/boost/beast/http/message.hpp(61): error: static assertion failed with "Fields type requirements not met" static_assert(is_fields<Fields>::value, ^ detected during: instantiation of class "boost::beast::http::header<1, Fields> [with Fields=boost::beast::http::detail::fields_model]" at line 487 of "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\type_traits" instantiation of class "std::is_constructible<_Ty, _Args...> [with _Ty=boost::beast::http::basic_string_body<char, std::char_traits<char>, std::allocator<char>>::reader, _Args=<boost::beast::http::header<1, boost::beast::http::detail::fields_model> &, std::basic_string<char, std::char_traits<char>, std::allocator<char>> &>]" at line 188 of "H:/3rdParty_lib/Boost/boost_1_71_0/boost/beast/http/type_traits.hpp" instantiation of class "boost::beast::http::is_body_reader<T, boost::beast::detail::void_t<decltype((<expression>))>> [with T=boost::beast::http::string_body]" at line 489 of "H:/3rdParty_lib/Boost/boost_1_71_0/boost/beast/http/impl/read.hpp" instantiation of "size_t={unsigned __int64} boost::beast::http::read(SyncReadStream &, DynamicBuffer &, boost::beast::http::message<isRequest, Body, boost::beast::http::basic_fields<Allocator>> &) [with SyncReadStream=boost::beast::tcp_stream, DynamicBuffer=boost::beast::flat_buffer, isRequest=0, Body=boost::beast::http::string_body, Allocator=std::allocator<char>]" at line 22 of "H:/TestIntelBoost/main.cpp" H:/3rdParty_lib/Boost/boost_1_71_0/boost/beast/http/message.hpp(265): error: static assertion failed with "Fields type requirements not met" static_assert(is_fields<Fields>::value, ^ detected during: instantiation of class "boost::beast::http::header<0, Fields> [with Fields=boost::beast::http::detail::fields_model]" at line 487 of "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\type_traits" instantiation of class "std::is_constructible<_Ty, _Args...> [with _Ty=boost::beast::http::basic_string_body<char, std::char_traits<char>, std::allocator<char>>::reader, _Args=<boost::beast::http::header<0, boost::beast::http::detail::fields_model> &, std::basic_string<char, std::char_traits<char>, std::allocator<char>> &>]" at line 191 of "H:/3rdParty_lib/Boost/boost_1_71_0/boost/beast/http/type_traits.hpp" instantiation of class "boost::beast::http::is_body_reader<T, boost::beast::detail::void_t<decltype((<expression>))>> [with T=boost::beast::http::string_body]" at line 489 of "H:/3rdParty_lib/Boost/boost_1_71_0/boost/beast/http/impl/read.hpp" instantiation of "size_t={unsigned __int64} boost::beast::http::read(SyncReadStream &, DynamicBuffer &, boost::beast::http::message<isRequest, Body, boost::beast::http::basic_fields<Allocator>> &) [with SyncReadStream=boost::beast::tcp_stream, DynamicBuffer=boost::beast::flat_buffer, isRequest=0, Body=boost::beast::http::string_body, Allocator=std::allocator<char>]" at line 22 of "H:/TestIntelBoost/main.cpp"
Please, find in attach a minimal example reproducing the issue which does not happen with Microsoft compiler and note that the same issue is described at the following link without a solution:
https://github.com/boostorg/beast/issues/1259
Here is the version of icl I am using:
$ icl Intel(R) C++ Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 19.0.4.245 Build 20190417 Copyright (C) 1985-2019 Intel Corporation. All rights reserved. icl: command line error: no files specified; for help type "icl /help"
Can you please check?
Thanks and best regards.
TCE Open Date:
Friday, January 10, 2020 - 05:46