| 88 | // std::<string, AttrValueWrapper> x = {"T", "$T"} |
| 89 | // is a named attr value placeholder. |
| 90 | struct AttrValueWrapper { |
| 91 | AttrValue proto; |
| 92 | |
| 93 | AttrValueWrapper() {} |
| 94 | |
| 95 | template <typename T> |
| 96 | AttrValueWrapper(T val) { // NOLINT(runtime/explicit) |
| 97 | SetAttrValue(val, &proto); |
| 98 | } |
| 99 | |
| 100 | private: |
| 101 | void InitFromString(StringPiece val); |
| 102 | }; |
| 103 | |
| 104 | // Constructs an AttrValue.func given the "name" and "attrs". |
| 105 | static AttrValueWrapper FunctionRef( |