Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ g++ -c -std=c++17 show.cpp
- show.cpp: In instantiation of ‘maybe_either<T>::maybe_either(U&&) [with U = either<var>; T = var]’:
- show.cpp:24:54: required from here
- show.cpp:15:68: error: no matching function for call to ‘std::variant<var, either<maybe_either<var> > >::variant(either<var>)’
- std::variant<T, either<maybe_either<T>>>(std::forward<U>(v)) {
- ^
- In file included from show.cpp:2:0:
- /usr/include/c++/7/variant:990:2: note: candidate: template<long unsigned int _Np, class _Up, class ... _Args, class> constexpr std::variant<_Types>::variant(std::in_place_index_t<_Np>, std::initializer_list<_Up>, _Args&& ...)
- variant(in_place_index_t<_Np>, initializer_list<_Up> __il,
- ^~~~~~~
- /usr/include/c++/7/variant:990:2: note: template argument deduction/substitution failed:
- show.cpp:15:68: note: ‘either<var>’ is not derived from ‘std::in_place_index_t<_Idx>’
- std::variant<T, either<maybe_either<T>>>(std::forward<U>(v)) {
- ^
- In file included from show.cpp:2:0:
- /usr/include/c++/7/variant:981:2: note: candidate: template<long unsigned int _Np, class ... _Args, class> constexpr std::variant<_Types>::variant(std::in_place_index_t<_Np>, _Args&& ...)
- variant(in_place_index_t<_Np>, _Args&&... __args)
- ^~~~~~~
- /usr/include/c++/7/variant:981:2: note: template argument deduction/substitution failed:
- show.cpp:15:68: note: ‘either<var>’ is not derived from ‘std::in_place_index_t<_Idx>’
- std::variant<T, either<maybe_either<T>>>(std::forward<U>(v)) {
- ^
- In file included from show.cpp:2:0:
- /usr/include/c++/7/variant:971:2: note: candidate: template<class _Tp, class _Up, class ... _Args, class> constexpr std::variant<_Types>::variant(std::in_place_type_t<_Tp>, std::initializer_list<_Up>, _Args&& ...)
- variant(in_place_type_t<_Tp>, initializer_list<_Up> __il,
- ^~~~~~~
- /usr/include/c++/7/variant:971:2: note: template argument deduction/substitution failed:
- show.cpp:15:68: note: ‘either<var>’ is not derived from ‘std::in_place_type_t<_Tp>’
- std::variant<T, either<maybe_either<T>>>(std::forward<U>(v)) {
- ^
- In file included from show.cpp:2:0:
- /usr/include/c++/7/variant:962:2: note: candidate: template<class _Tp, class ... _Args, class> constexpr std::variant<_Types>::variant(std::in_place_type_t<_Tp>, _Args&& ...)
- variant(in_place_type_t<_Tp>, _Args&&... __args)
- ^~~~~~~
- /usr/include/c++/7/variant:962:2: note: template argument deduction/substitution failed:
- show.cpp:15:68: note: ‘either<var>’ is not derived from ‘std::in_place_type_t<_Tp>’
- std::variant<T, either<maybe_either<T>>>(std::forward<U>(v)) {
- ^
- In file included from show.cpp:2:0:
- /usr/include/c++/7/variant:953:2: note: candidate: template<class _Tp, class, class, class> constexpr std::variant<_Types>::variant(_Tp&&)
- variant(_Tp&& __t)
- ^~~~~~~
- /usr/include/c++/7/variant:953:2: note: template argument deduction/substitution failed:
- /usr/include/c++/7/variant:951:6: error: invalid use of incomplete type ‘struct std::variant<var, either<maybe_either<var> > >::__to_type_impl<18446744073709551615, false>’
- typename = enable_if_t<__exactly_once<__accepted_type<_Tp&&>>
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- && is_constructible_v<__accepted_type<_Tp&&>, _Tp&&>>>
- ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- /usr/include/c++/7/variant:924:9: note: declaration of ‘struct std::variant<var, either<maybe_either<var> > >::__to_type_impl<18446744073709551615, false>’
- struct __to_type_impl;
- ^~~~~~~~~~~~~~
- /usr/include/c++/7/variant:951:6: error: invalid use of incomplete type ‘struct std::variant<var, either<maybe_either<var> > >::__to_type_impl<18446744073709551615, false>’
- typename = enable_if_t<__exactly_once<__accepted_type<_Tp&&>>
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- && is_constructible_v<__accepted_type<_Tp&&>, _Tp&&>>>
- ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- /usr/include/c++/7/variant:924:9: note: declaration of ‘struct std::variant<var, either<maybe_either<var> > >::__to_type_impl<18446744073709551615, false>’
- struct __to_type_impl;
- ^~~~~~~~~~~~~~
- /usr/include/c++/7/variant:944:7: note: candidate: std::variant<_Types>::variant(std::variant<_Types>&&) [with _Types = {var, either<maybe_either<var> >}]
- variant(variant&&)
- ^~~~~~~
- /usr/include/c++/7/variant:944:7: note: no known conversion for argument 1 from ‘either<var>’ to ‘std::variant<var, either<maybe_either<var> > >&&’
- /usr/include/c++/7/variant:943:7: note: candidate: std::variant<_Types>::variant(const std::variant<_Types>&) [with _Types = {var, either<maybe_either<var> >}]
- variant(const variant&) = default;
- ^~~~~~~
- /usr/include/c++/7/variant:943:7: note: no known conversion for argument 1 from ‘either<var>’ to ‘const std::variant<var, either<maybe_either<var> > >&’
- /usr/include/c++/7/variant:941:17: note: candidate: constexpr std::variant<_Types>::variant() [with _Types = {var, either<maybe_either<var> >}]
- constexpr variant()
- ^~~~~~~
- /usr/include/c++/7/variant:941:17: note: candidate expects 0 arguments, 1 provided
Advertisement
Add Comment
Please, Sign In to add comment