Skip to content

Regression after 1.62: variant<recursive_wrapper<X>, ...> is not constructible from X when X is a variant #100

@Kojoley

Description

@Kojoley

Regressed in 9272805

#include <boost/variant.hpp>

struct Nil {};

typedef boost::variant<
                Nil
              , double
            >
        Atom;

typedef boost::variant<
                Nil
#if 1
                  , boost::recursive_wrapper<Atom>
#else
                  , Atom
#endif
                >
        Base;

int main()
{
    Atom atom;
    Base base = atom;
}

Removing these specializations fixes the compilation

template <class T, class U> struct is_constructible<recursive_wrapper<T>, U > : boost::false_type{};
template <class T, class U> struct is_constructible<recursive_wrapper<T>, const U > : boost::false_type{};
template <class T, class U> struct is_constructible<recursive_wrapper<T>, U& > : boost::false_type{};
template <class T, class U> struct is_constructible<recursive_wrapper<T>, const U& > : boost::false_type{};
template <class T, class U> struct is_constructible<recursive_wrapper<T>, recursive_wrapper<U> > : boost::false_type{};
template <class T, class U> struct is_constructible<recursive_wrapper<T>, const recursive_wrapper<U> > : boost::false_type{};
template <class T, class U> struct is_constructible<recursive_wrapper<T>, recursive_wrapper<U>& > : boost::false_type{};
template <class T, class U> struct is_constructible<recursive_wrapper<T>, const recursive_wrapper<U>& > : boost::false_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