https://www.godbolt.org/z/Y794EoM7h#include <cstddef>
#include <vector>
#include <boost/asio/buffer.hpp>
int main(int argc, char** argv)
{
std::vector<std::byte, std::allocator<std::byte>> otherBuff;
auto buffer = boost::asio::buffer<std::byte, std::allocator<std::byte>>(otherBuff);
//auto buffer = boost::asio::buffer(otherBuff); // compiles fine
(void)buffer;
return 1;
}
вопрос почему подчеркнутая строка не компилируется а вот следующая с type deduction компилится.
Ошибка компиляции :
C:/data/msvc/14.29.30038.1/include\xstring(1242): error C2039: 'char_type': is not a member of 'std::allocator<std::byte>'
<source>(9): note: see declaration of 'std::allocator<std::byte>'
<source>(10): note: see reference to class template instantiation 'std::basic_string_view<std::byte,std::allocator<std::byte>>' being compiled
C:/data/msvc/14.29.30038.1/include\xstring(1242): error C2146: syntax error: missing '>' before identifier 'char_type'
вектор матчится к string почему?