Fix breakages in OSS builds when tstring is enabled.
PiperOrigin-RevId: 287922617 Change-Id: I76b055576dbf47ee01673c8350399b5d92e1ec9e
This commit is contained in:
parent
75fbbf8c7e
commit
1a416ed6a5
@ -16,6 +16,7 @@ limitations under the License.
|
|||||||
#ifndef TENSORFLOW_CORE_PLATFORM_TSTRING_H_
|
#ifndef TENSORFLOW_CORE_PLATFORM_TSTRING_H_
|
||||||
#define TENSORFLOW_CORE_PLATFORM_TSTRING_H_
|
#define TENSORFLOW_CORE_PLATFORM_TSTRING_H_
|
||||||
|
|
||||||
|
#include <ostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
// TODO(b/138799229): Used to toggle until global presubmits pass.
|
// TODO(b/138799229): Used to toggle until global presubmits pass.
|
||||||
@ -160,12 +161,14 @@ class tstring {
|
|||||||
return T(str_.data(), str_.size());
|
return T(str_.data(), str_.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef PLATFORM_GOOGLE
|
||||||
template <typename T,
|
template <typename T,
|
||||||
typename std::enable_if<std::is_same<T, absl::AlphaNum>::value,
|
typename std::enable_if<std::is_same<T, absl::AlphaNum>::value,
|
||||||
T>::type* = nullptr>
|
T>::type* = nullptr>
|
||||||
operator T() const {
|
operator T() const {
|
||||||
return T(str_);
|
return T(str_);
|
||||||
}
|
}
|
||||||
|
#endif // PLATFORM_GOOGLE
|
||||||
|
|
||||||
bool empty() const { return str_.empty(); }
|
bool empty() const { return str_.empty(); }
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user