C++ Logo

std-proposals

Advanced search

Re: [std-proposals] operator typename+ (Tuple -> ParamPack)

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Sun, 12 Nov 2023 17:27:55 +0000
On Sun, Nov 12, 2023 at 5:15 PM Frederick Virchanza Gotham
<cauldwell.thomas_at_[hidden]> wrote:
>
> template<int i, int j, int k, typename A> class SomeClass1 {};
>
> template<int i, int j, int k, typename A> class SomeClass2 {};
>
> typedef SomeClass1<1,2,3,long> Donkey;
> typedef SomeClass2<4,5,6,long> Monkey;
>
> Donkey Func(Monkey const &arg)
> {
> Donkey< Monkey+ > obj(arg);
> return obj;
> }


I typed this up on my phone during play rehearsal while waiting for
others to finish their scenes... I didn't give it enough attention.
The above code snippet should have been:

template<int i, int j, int k, typename A> class SomeClass1 { /*
constructor needed in here */ };
template<int i, int j, int k, typename A> class SomeClass2 {};

typedef SomeClass2<4,5,6,long> Monkey;

auto Func(Monkey const &arg)
{
    SomeClass1< Monkey+ > obj(arg);
    return obj;
}

Received on 2023-11-12 17:28:06