namespace product_namespace {
enum class Command {
enum values...
};
// tag_invoke implementation in source file, make no sense here
Command tag_invoke(const boost::json::value_to_tag& vt, boost::json::value const& jv);
void tag_invoke(const boost::json::value_from_tag& vt, boost::json::value& jv, const Command& command);
inline boost::json::value Digest() const {
Command Cmd = Command::SomeValue;
return boost::json::value{
{"cmd", Cmd}, // Compiler error here. See below
...
};
};
Может ли кто-нибудь мне помочь, как решить эту проблему? Даже в чем может быть причина обновления версии с 1.77 до 1.85?
Спасибо
Полный журнал ошибок компилятора (пришлось изменить файл исходный журнал, чтобы удалить некоторую конфиденциальную информацию компании):
In file included from :455:
In file included from .../cmake_pch.hxx:5:
In file included from .../pch.h:57:
In file included from ...thirdparty/boost/include/boost/json.hpp:15:
In file included from ...thirdparty/boost/include/boost/json/array.hpp
In file included from ...thirdparty/boost/include/boost/json/value.hpp:4317:
.../thirdparty/boost/include/boost/json/impl/value_ref.hpp:36:12: error: no matching constructor for initialization of 'boost::json::value'
return value(
^
.../thirdparty/boost/include/boost/json/value_ref.hpp:204:16: note: in instantiation of function template specialization 'boost::json::value_ref::from_const' requested here
: cf_{&from_const, &t}
^
.../Request.h:189:30: note: in instantiation of function template specialization 'boost::json::value_ref::value_ref' requested here
{Request::NameOfCmd, Cmd},
^
.../thirdparty/boost/include/boost/json/value.hpp:247:5: note: candidate constructor not viable: no known conversion from 'const product_namespace::Command' to 'const boost::json::value' for 1st argument
value(
^
.../thirdparty/boost/include/boost/json/value.hpp:305:5: note: candidate constructor not viable: no known conversion from 'const product_namespace::Command' to 'boost::json::value' for 1st argument
value(
^
.../thirdparty/boost/include/boost/json/value.hpp:329:5: note: candidate constructor not viable: no known conversion from 'const product_namespace::Command' to 'std::nullptr_t' for 1st argument
value(
^
.../thirdparty/boost/include/boost/json/value.hpp:384:5: note: candidate constructor not viable: no known conversion from 'const product_namespace::Command' to 'signed char' for 1st argument
value(
^
.../thirdparty/boost/include/boost/json/value.hpp:406:5: note: candidate constructor not viable: no known conversion from 'const product_namespace::Command' to 'short' for 1st argument
value(
^
.../thirdparty/boost/include/boost/json/value.hpp:428:5: note: candidate constructor not viable: no known conversion from 'const product_namespace::Command' to 'int' for 1st argument
value(
^
.../thirdparty/boost/include/boost/json/value.hpp:450:5: note: candidate constructor not viable: no known conversion from 'const product_namespace::Command' to 'long' for 1st argument
value(
^
.../thirdparty/boost/include/boost/json/value.hpp:472:5: note: candidate constructor not viable: no known conversion from 'const product_namespace::Command' to 'long long' for 1st argument
value(
^
.../thirdparty/boost/include/boost/json/value.hpp:494:5: note: candidate constructor not viable: no known conversion from 'const product_namespace::Command' to 'unsigned char' for 1st argument
value(
^
.../thirdparty/boost/include/boost/json/value.hpp:516:5: note: candidate constructor not viable: no known conversion from 'const product_namespace::Command' to 'unsigned short' for 1st argument
value(
^
.../thirdparty/boost/include/boost/json/value.hpp:538:5: note: candidate constructor not viable: no known conversion from 'const product_namespace::Command' to 'unsigned int' for 1st argument
value(
^
.../thirdparty/boost/include/boost/json/value.hpp:560:5: note: candidate constructor not viable: no known conversion from 'const product_namespace::Command' to 'unsigned long' for 1st argument
value(
^
.../thirdparty/boost/include/boost/json/value.hpp:582:5: note: candidate constructor not viable: no known conversion from 'const product_namespace::Command' to 'unsigned long long' for 1st argument
value(
^
.../thirdparty/boost/include/boost/json/value.hpp:604:5: note: candidate constructor not viable: no known conversion from 'const product_namespace::Command' to 'double' for 1st argument
value(
^
.../thirdparty/boost/include/boost/json/value.hpp:629:5: note: candidate constructor not viable: no known conversion from 'const product_namespace::Command' to 'boost::json::string_view' (aka 'basic_string_view') for 1st argument
value(
^
.../thirdparty/boost/include/boost/json/value.hpp:656:5: note: candidate constructor not viable: no known conversion from 'const product_namespace::Command' to 'const char *' for 1st argument
value(
^
.../thirdparty/boost/include/boost/json/value.hpp:711:5: note: candidate constructor not viable: no known conversion from 'const product_namespace::Command' to 'const boost::json::string' for 1st argument
value(
^
.../thirdparty/boost/include/boost/json/value.hpp:738:5: note: candidate constructor not viable: no known conversion from 'const product_namespace::Command' to 'boost::json::string' for 1st argument
value(
^
.../thirdparty/boost/include/boost/json/value.hpp:774:5: note: candidate constructor not viable: no known conversion from 'const product_namespace::Command' to 'boost::json::string_kind_t' for 1st argument
value(
^
.../thirdparty/boost/include/boost/json/value.hpp:828:5: note: candidate constructor not viable: no known conversion from 'const product_namespace::Command' to 'const boost::json::array' for 1st argument
value(
^
.../thirdparty/boost/include/boost/json/value.hpp:855:5: note: candidate constructor not viable: no known conversion from 'const product_namespace::Command' to 'boost::json::array' for 1st argument
value(
^
.../thirdparty/boost/include/boost/json/value.hpp:891:5: note: candidate constructor not viable: no known conversion from 'const product_namespace::Command' to 'boost::json::array_kind_t' for 1st argument
value(
^
.../thirdparty/boost/include/boost/json/value.hpp:945:5: note: candidate constructor not viable: no known conversion from 'const product_namespace::Command' to 'const boost::json::object' for 1st argument
value(
^
.../thirdparty/boost/include/boost/json/value.hpp:972:5: note: candidate constructor not viable: no known conversion from 'const product_namespace::Command' to 'boost::json::object' for 1st argument
value(
^
.../thirdparty/boost/include/boost/json/value.hpp
value(
^
.../thirdparty/boost/include/boost/json/value.hpp
value(
^
.../thirdparty/boost/include/boost/json/value.hpp:362:5: note: candidate template ignored: requirement 'std::is_same::value' was not satisfied [with T = product_namespace::Command]
value(
^
.../thirdparty/boost/include/boost/json/value.hpp:78:5: note: candidate constructor not viable: requires single argument 'ua', but 2 arguments were provided
value(
^
.../thirdparty/boost/include/boost/json/value.hpp:85:5: note: candidate constructor not viable: requires single argument 'uo', but 2 arguments were provided
value(
^
.../thirdparty/boost/include/boost/json/value.hpp:174:5: note: candidate constructor not viable: requires single argument 'sp', but 2 arguments were provided
value(storage_ptr sp) noexcept
^
.../thirdparty/boost/include/boost/json/value.hpp:201:5: note: candidate constructor not viable: requires single argument 'other', but 2 arguments were provided
value(pilfered other) noexcept
^
.../thirdparty/boost/include/boost/json/value.hpp:222:5: note: candidate constructor not viable: requires single argument 'other', but 2 arguments were provided
value(value const& other)
^
.../thirdparty/boost/include/boost/json/value.hpp:271:5: note: candidate constructor not viable: requires single argument 'other', but 2 arguments were provided
value(value&& other) noexcept;
^
.../thirdparty/boost/include/boost/json/value.hpp:687:5: note: candidate constructor not viable: requires single argument 'other', but 2 arguments were provided
value(
^
.../thirdparty/boost/include/boost/json/value.hpp:805:5: note: candidate constructor not viable: requires single argument 'other', but 2 arguments were provided
value(array other) noexcept
^
.../thirdparty/boost/include/boost/json/value.hpp:922:5: note: candidate constructor not viable: requires single argument 'other', but 2 arguments were provided
value(object other) noexcept
^
.../thirdparty/boost/include/boost/json/value.hpp:91:5: note: candidate constructor not viable: requires 3 arguments, but 2 were provided
value(
^
.../thirdparty/boost/include/boost/json/value.hpp:153:5: note: candidate constructor not viable: requires 0 arguments, but 2 were provided
value() noexcept
^
.../thirdparty/boost/include/boost/json/value.hpp:99:5: note: candidate constructor not viable: requires 4 arguments, but 2 were provided
value(
^
Подробнее здесь: https://stackoverflow.com/questions/785 ... iler-error
Мобильная версия