Home
last modified time | relevance | path

Searched defs:ValueUnion (Results 1 – 1 of 1) sorted by relevance

/llvm-project/third-party/benchmark/src/
H A Dsysinfo.cc112 struct ValueUnion { struct
113 union DataT {
119 using DataPtr = std::unique_ptr<DataT, decltype(&std::free)>;
122 std::size_t size;
123 DataPtr buff;
126 ValueUnion() : size(0), buff(nullptr, &std::free) {} in ValueUnion() argument
128 explicit ValueUnion(std::size_t buff_size) in ValueUnion() argument
134 explicit operator bool() const { return bool(buff); } in operator bool()
136 char* data() const { return buff->bytes; } in data()
138 std::string GetAsString() const { return std::string(data()); } in GetAsString()
[all …]