Fix breakages in OSS builds when tstring is enabled.

PiperOrigin-RevId: 287922617
Change-Id: I76b055576dbf47ee01673c8350399b5d92e1ec9e
This commit is contained in:
Dero Gharibian 2020-01-02 17:42:12 -08:00 committed by TensorFlower Gardener
parent 75fbbf8c7e
commit 1a416ed6a5

View File

@ -16,6 +16,7 @@ limitations under the License.
#ifndef TENSORFLOW_CORE_PLATFORM_TSTRING_H_
#define TENSORFLOW_CORE_PLATFORM_TSTRING_H_
#include <ostream>
#include <string>
// TODO(b/138799229): Used to toggle until global presubmits pass.
@ -160,12 +161,14 @@ class tstring {
return T(str_.data(), str_.size());
}
#ifdef PLATFORM_GOOGLE
template <typename T,
typename std::enable_if<std::is_same<T, absl::AlphaNum>::value,
T>::type* = nullptr>
operator T() const {
return T(str_);
}
#endif // PLATFORM_GOOGLE
bool empty() const { return str_.empty(); }