Displaying 4 results from an estimated 4 matches for "not_null_impl".
2019 Apr 06
4
[RFC] Should we add isa_or_null<>?
What about a type not_null_impl<T> and we could write:
then you could just write bool x = isa<T>(not_null(val));
We provide a function not_null<T> that returns a not_null_impl<T>:
template<typename T>
not_null_impl<T> not_null(T *t) { return not_null_impl<T>{t}; }
and a specialization...
2019 Apr 07
2
[RFC] Should we add isa_or_null<>?
...PM Zachary Turner <zturner at google.com> wrote:
> Sorry, brain isn't fully working. I meant to call the function / type
> `or_null` instead of `not_null`
>
> On Sat, Apr 6, 2019 at 11:16 AM Zachary Turner <zturner at google.com> wrote:
>
>> What about a type not_null_impl<T> and we could write:
>>
>> then you could just write bool x = isa<T>(not_null(val));
>>
>> We provide a function not_null<T> that returns a not_null_impl<T>:
>>
>> template<typename T>
>> not_null_impl<T> not_null(T *t)...
2019 Apr 07
2
[RFC] Should we add isa_or_null<>?
...le.com<mailto:zturner at google.com>> wrote:
Sorry, brain isn't fully working. I meant to call the function / type `or_null` instead of `not_null`
On Sat, Apr 6, 2019 at 11:16 AM Zachary Turner <zturner at google.com<mailto:zturner at google.com>> wrote:
What about a type not_null_impl<T> and we could write:
then you could just write bool x = isa<T>(not_null(val));
We provide a function not_null<T> that returns a not_null_impl<T>:
template<typename T>
not_null_impl<T> not_null(T *t) { return not_null_impl<T>{t}; }
and a specialization...
2019 Apr 04
4
[RFC] Should we add isa_or_null<>?
On Thu, Apr 4, 2019 at 12:58 PM Chris Lattner <clattner at nondot.org> wrote:
>
>
>
> > On Apr 4, 2019, at 5:37 AM, Don Hinton via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> >
> > I'd like to propose adding `isa_or_null<>` to replace the following usage pattern that's relatively common in conditionals:
> >
> > var &&