If you wish to share a value explicitly (a value not shared automatically through one of the BUILDER_FLAG_SHARE_* flags) you can do so with these functions. Or if you wish to turn those flags off for performance reasons and still do some explicit sharing. For example: builder.IndirectDouble(M_PI); auto id = builder.LastValue(); // Remember where we stored it. .. more code goes here .. builder.Reu
| 1273 | // LastValue works regardless of whether the value has a key or not. |
| 1274 | // Works on any data type. |
| 1275 | struct Value; |
| 1276 | Value LastValue() { return stack_.back(); } |
| 1277 | void ReuseValue(Value v) { stack_.push_back(v); } |
| 1278 | void ReuseValue(const char *key, Value v) { |
no outgoing calls
no test coverage detected