jeudi 30 mars 2017

How can a struct inherits itself?

template <bool condition>
struct when;

template <typename It, typename = void>
struct at_impl : at_impl<It, when<true>> { };

struct at_t {
    template <typename Xs, typename N>
    constexpr decltype(auto) operator()(Xs&& xs, N const& n) const;
};

constexpr at_t at{};

int main()
{
}

How could this program compiled? How can a struct inherits itself?! I don't know what's going on here. Is this a new feture in c++?

Aucun commentaire:

Enregistrer un commentaire