intern_boxed_field_ref
commit9da0128c1dcbd849a74cfff0de56c4095fe35ea1
authorDave Kwon <dokwon@meta.com>
Mon, 24 Oct 2022 22:23:34 +0000 (24 15:23 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Mon, 24 Oct 2022 22:23:34 +0000 (24 15:23 -0700)
treed11c0b4e5889450ee4eaf26eaf8fa9a504f86280
parentff6279c8a4e691d6ba572b09c5305780c901da52
intern_boxed_field_ref

Summary:
intern_boxed_field_ref is a field_ref for boxed_value to support thrift.InternBox. It currently only supports Thrift struct. It passes around op::getDefault to get the constant immutable default value for deduping so that user can reset with `intern_boxed_field_ref::reset`. For now, we do not want any const T* to be used for interning, but only supports default value.

intern_boxed_field_ref provides fill semantic with isset, which can distinguish absent and empty.

Reviewed By: Alfus

Differential Revision: D40422910

fbshipit-source-id: e6aa2cbeba45821ffd6aff188660eec1ccce7da8
third-party/thrift/src/thrift/lib/cpp2/FieldRef.h
third-party/thrift/src/thrift/test/FieldRefTest.cpp