• Re: Why doesn't this build?

    From Vir Campestris@vir.campestris@invalid.invalid to comp.lang.c++ on Wed Dec 3 11:05:14 2025
    From Newsgroup: comp.lang.c++

    On 02/12/2025 21:43, Chris M. Thomasson wrote:
    Not exactly sure. Humm. I noticed that wrt the following: _____________________
    #include <utility>
    #include <iostream>

    enum e {E};

    template <e f> class b {};

    template <typename f> class A : std::pair<int, b<E> >
    {
    -a-a-a-a-a-a-a A() : std::pair<int, b<E> >() {}
    };

    template <e f> class B : std::pair<int, b<f> >
    {
    -a-a-a-a-a-a-a B() : std::pair<int, b<f> >() {}
    };


    int main()
    {
    std::cout << "Hello..." << std::endl;

    -a-a-a return 0;
    }
    _____________________

    works (aka compiles), but if I put a typename for e in class B wrt <e
    , the compiler cakes its pants.

    It occurred to me later - what compiler are you using? I've tried G++
    and clang++ on Unix. I don't have MS compiler available.

    And I just realised I don't need that pair, just the templated base
    class b to show the problem.

    Andy
    --
    Do not listen to rumour, but, if you do, do not believe it.
    Ghandi.
    --- Synchronet 3.21b-Linux NewsLink 1.2