markrooney / kdb-templates

A C++17 template library for converting to/from native C++ types to KDB

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No matching constructor for initialization of 'any_list'

mortensorensen opened this issue · comments

Hi Mark, thanks for a great library. I'm getting compilation error on MacOS clang 18.1.8 with C++17 flags enabled.

I can remove nested_list from the any_list variant to make it compile, but not ideal of course.

kdb.hpp:464:39: error: no matching constructor for initialization of 'any_list' (aka 'variant<vector<bool>, vector<float>, vector<double>, vector<unsigned char>, vector<char>, vector<int>, vector<short>, vector<long long>, vector<std::string>, vector<std::variant<bool, unsigned char, short, int, long long, float, double, char, std::string>>, vector<list_wrapper>>') 464 | list_wrapper(Ts&&... items) : value{std::forward<Ts>(items)...} {} | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/local/opt/llvm/bin/../include/c++/v1/__memory/allocator.h:173:24: note: in instantiation of function template specialization 'kdb::type::list_wrapper::list_wrapper<kdb::type::list_wrapper &>' requested here 173 | ::new ((void*)__p) _Up(std::forward<_Args>(__args)...); | ^ /usr/local/opt/llvm/bin/../include/c++/v1/__memory/allocator_traits.h:296:9: note: in instantiation of function template specialization 'std::allocator<kdb::type::list_wrapper>::construct<kdb::type::list_wrapper, kdb::type::list_wrapper &>' requested here 296 | __a.construct(__p, std::forward<_Args>(__args)...); | ^ /usr/local/opt/llvm/bin/../include/c++/v1/__memory/uninitialized_algorithms.h:550:31: note: in instantiation of function template specialization 'std::allocator_traits<std::allocator<kdb::type::list_wrapper>>::construct<kdb::type::list_wrapper, kdb::type::list_wrapper &, void>' requested here 550 | allocator_traits<_Alloc>::construct(__alloc, std::__to_address(__first2), *__first1); | ^ /usr/local/opt/llvm/bin/../include/c++/v1/__memory/uninitialized_algorithms.h:592:33: note: in instantiation of function template specialization 'std::__uninitialized_allocator_copy_impl<std::allocator<kdb::type::list_wrapper>, kdb::type::list_wrapper *, kdb::type::list_wrapper *, kdb::type::list_wrapper *>' requested here 592 | auto __result = std::__uninitialized_allocator_copy_impl( | ^ /usr/local/opt/llvm/bin/../include/c++/v1/vector:1082:22: note: in instantiation of function template specialization 'std::__uninitialized_allocator_copy<std::allocator<kdb::type::list_wrapper>, kdb::type::list_wrapper *, kdb::type::list_wrapper *, kdb::type::list_wrapper *>' requested here 1082 | __tx.__pos_ = std::__uninitialized_allocator_copy(__alloc(), __first, __last, __tx.__pos_); | ^ /usr/local/opt/llvm/bin/../include/c++/v1/vector:760:7: note: in instantiation of function template specialization 'std::vector<kdb::type::list_wrapper>::__construct_at_end<kdb::type::list_wrapper *, kdb::type::list_wrapper *>' requested here 760 | __construct_at_end(__first, __last, __n); | ^ /usr/local/opt/llvm/bin/../include/c++/v1/vector:1195:3: note: in instantiation of function template specialization 'std::vector<kdb::type::list_wrapper>::__init_with_size<kdb::type::list_wrapper *, kdb::type::list_wrapper *>' requested here 1195 | __init_with_size(__x.__begin_, __x.__end_, __x.size()); | ^ /usr/local/opt/llvm/bin/../include/c++/v1/__type_traits/invoke.h:344:49: note: in instantiation of member function 'std::vector<kdb::type::list_wrapper>::vector' requested here 344 | { return static_cast<_Fp&&>(__f)(static_cast<_Args&&>(__args)...); } | ^ /usr/local/opt/llvm/bin/../include/c++/v1/variant:1177:35: note: candidate constructor not viable: no known conversion from 'kdb::type::list_wrapper' to 'const variant<vector<bool>, vector<float>, vector<double>, vector<unsigned char>, vector<char>, vector<int>, vector<short>, vector<long long>, vector<string>, vector<variant<bool, unsigned char, short, int, long long, float, double, char, string>>, vector<list_wrapper>>' for 1st argument 1177 | _LIBCPP_HIDE_FROM_ABI constexpr variant(const variant&) = default; | ^ ~~~~~~~~~~~~~~ /usr/local/opt/llvm/bin/../include/c++/v1/variant:1178:35: note: candidate constructor not viable: no known conversion from 'kdb::type::list_wrapper' to 'variant<vector<bool>, vector<float>, vector<double>, vector<unsigned char>, vector<char>, vector<int>, vector<short>, vector<long long>, vector<string>, vector<variant<bool, unsigned char, short, int, long long, float, double, char, string>>, vector<list_wrapper>>' for 1st argument 1178 | _LIBCPP_HIDE_FROM_ABI constexpr variant(variant&&) = default; | ^ ~~~~~~~~~ /usr/local/opt/llvm/bin/../include/c++/v1/variant:1187:35: note: candidate template ignored: substitution failure [with _Arg = kdb::type::list_wrapper &, $1 = 0, $2 = 0, $3 = 0]: no type named 'type' in 'std::invoke_result<std::__variant_detail::__all_overloads<std::__variant_detail::__overload<std::vector<bool>, 0>, std::__variant_detail::__overload<std::vector<float>, 1>, std::__variant_detail::__overload<std::vector<double>, 2>, std::__variant_detail::__overload<std::vector<unsigned char>, 3>, std::__variant_detail::__overload<std::vector<char>, 4>, std::__variant_detail::__overload<std::vector<int>, 5>, std::__variant_detail::__overload<std::vector<short>, 6>, std::__variant_detail::__overload<std::vector<long long>, 7>, std::__variant_detail::__overload<std::vector<std::string>, 8>, std::__variant_detail::__overload<std::vector<std::variant<bool, unsigned char, short, int, long long, float, double, char, std::string>>, 9>, std::__variant_detail::__overload<std::vector<kdb::type::list_wrapper>, 10>>, kdb::type::list_wrapper &, kdb::type::list_wrapper &>' 1187 | _LIBCPP_HIDE_FROM_ABI constexpr variant(_Arg&& __arg) noexcept(is_nothrow_constructible_v<_Tp, _Arg>) | ^ /usr/local/opt/llvm/bin/../include/c++/v1/variant:1195:44: note: candidate template ignored: could not match 'in_place_index_t<_Ip>' against 'kdb::type::list_wrapper' 1195 | _LIBCPP_HIDE_FROM_ABI explicit constexpr variant(in_place_index_t<_Ip>, _Args&&... __args) noexcept( | ^ /usr/local/opt/llvm/bin/../include/c++/v1/variant:1215:44: note: candidate template ignored: could not match 'in_place_type_t<_Tp>' against 'kdb::type::list_wrapper' 1215 | _LIBCPP_HIDE_FROM_ABI explicit constexpr variant(in_place_type_t<_Tp>, _Args&&... __args) noexcept( | ^ /usr/local/opt/llvm/bin/../include/c++/v1/variant:1174:35: note: candidate constructor template not viable: requires 0 arguments, but 1 was provided 1174 | _LIBCPP_HIDE_FROM_ABI constexpr variant() noexcept(is_nothrow_default_constructible_v<__first_type>) | ^ /usr/local/opt/llvm/bin/../include/c++/v1/variant:1205:44: note: candidate constructor template not viable: requires at least 2 arguments, but 1 was provided 1205 | _LIBCPP_HIDE_FROM_ABI explicit constexpr variant( | ^ 1206 | in_place_index_t<_Ip>, | ~~~~~~~~~~~~~~~~~~~~~~ 1207 | initializer_list<_Up> __il, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1208 | _Args&&... __args) noexcept(is_nothrow_constructible_v<_Tp, initializer_list<_Up>&, _Args...>) | ~~~~~~~~~~~~~~~~~ /usr/local/opt/llvm/bin/../include/c++/v1/variant:1224:44: note: candidate constructor template not viable: requires at least 2 arguments, but 1 was provided 1224 | _LIBCPP_HIDE_FROM_ABI explicit constexpr variant( | ^ 1225 | in_place_type_t<_Tp>, | ~~~~~~~~~~~~~~~~~~~~~ 1226 | initializer_list<_Up> __il, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1227 | _Args&&... __args) noexcept(is_nothrow_constructible_v<_Tp, initializer_list< _Up>&, _Args...>) | ~~~~~~~~~~~~~~~~~ 1 error generated.