hokein added a comment.

In D125311#3524190 <https://reviews.llvm.org/D125311#3524190>, @sammccall wrote:

> In D125311#3523388 <https://reviews.llvm.org/D125311#3523388>, @hokein wrote:
>
>> In D125311#3503452 <https://reviews.llvm.org/D125311#3503452>, @sammccall 
>> wrote:
>>
>>> This looks good, but if that's the idiom we should add it to cook() also.
>>
>> cook is more tricky, it takes a TokenStream, and returns a new one with an 
>> allocator payload:
>>
>> - the input TokenStream doesn't have a payload, this is OK
>> - the input TokenStream has a payload, but what if the type of payload is 
>> not an allocator?
>
> Payload is opaque, it can be a pair of {new payload, inner payload}. e.g.
>
>   void TokenStream::addPayload(shared_ptr<void> P) {
>     Payload = make_shared<pair<shared_ptr<void>, 
> shared_ptr<void>>>(std::move(P), std::move(Payload));
>   }

Ohh, right, this is clever!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125311/new/

https://reviews.llvm.org/D125311

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to