summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Yurii Zubrytskyi <zyy@google.com> 2024-11-19 17:00:00 -0800
committer Yurii Zubrytskyi <zyy@google.com> 2024-11-20 18:51:38 -0800
commitc53a3da2e1094414b95ebf9aebd3449f7df49063 (patch)
tree8f3d87572a64ca34c2a833d233c8cac18fa62de7
parent3c943276af755440918913b246ed32e1495716bd (diff)
[aapt2] Small cleanup of utils
Test: build + aapt2_tests Flag: EXEMPT cleanup Change-Id: I3046a3b34e99b1250b4739b184d022a22685a4b5
-rw-r--r--tools/aapt2/util/Util.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/tools/aapt2/util/Util.h b/tools/aapt2/util/Util.h
index 40ff5b633d97..03da460affb5 100644
--- a/tools/aapt2/util/Util.h
+++ b/tools/aapt2/util/Util.h
@@ -111,8 +111,8 @@ const char* GetToolName();
// Retrieves the build fingerprint of aapt2.
std::string GetToolFingerprint();
-template <typename T>
-typename std::enable_if<std::is_arithmetic<T>::value, int>::type compare(const T& a, const T& b) {
+template <std::integral T>
+int compare(T a, T b) {
if (a < b) {
return -1;
} else if (a > b) {
@@ -123,10 +123,7 @@ typename std::enable_if<std::is_arithmetic<T>::value, int>::type compare(const T
// Makes a std::unique_ptr<> with the template parameter inferred by the compiler.
// This will be present in C++14 and can be removed then.
-template <typename T, class... Args>
-std::unique_ptr<T> make_unique(Args&&... args) {
- return std::unique_ptr<T>(new T{std::forward<Args>(args)...});
-}
+using std::make_unique;
// Writes a set of items to the std::ostream, joining the times with the provided separator.
template <typename Container>