Skip to content

Regression in boost 1.82 from 1.79 - cannot add std::vector to json::object #917

@steve-numeus

Description

@steve-numeus

Version of Boost

1.82

Steps necessary to reproduce the problem

Upgrade from boost 1.79 to 1.82

Previously it was possible to add a std::vector<std::string> to a boost::json::obejct, this no longer works.

#include <iostream>
#include <vector>
#include <boost/json.hpp>

int main()
{
    std::vector<std::string> channels = {"foo", "bar"};
    boost::json::object params = {{"channels", std::move(channels)}};
    std::cout << params << '\n';
    return 0;
}

Error:

/usr/include/boost/json/impl/value_ref.hpp:49:12: error: no matching function for call to
    boost::json::value::value(std::remove_reference<std::vector<std::__cxx11::basic_string<char> >&>::type,
        std::remove_reference<boost::json::storage_ptr&>::type)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions