Replace Maybe with std::optional
With c++17, std::optional provides the functionality that Maybe
provided.
Bug: 183215655
Test: aapt2_tests
Change-Id: I62bb9c2fa4985dc5217a6ed153df92b85ad9a034
diff --git a/tools/aapt2/test/Common.h b/tools/aapt2/test/Common.h
index 777ca5c..7006964 100644
--- a/tools/aapt2/test/Common.h
+++ b/tools/aapt2/test/Common.h
@@ -55,7 +55,7 @@
T* GetValueForConfigAndProduct(ResourceTable* table, const android::StringPiece& res_name,
const android::ConfigDescription& config,
const android::StringPiece& product) {
- Maybe<ResourceTable::SearchResult> result = table->FindResource(ParseNameOrDie(res_name));
+ std::optional<ResourceTable::SearchResult> result = table->FindResource(ParseNameOrDie(res_name));
if (result) {
ResourceConfigValue* config_value = result.value().entry->FindValue(config, product);
if (config_value) {
@@ -130,7 +130,7 @@
// Add a print method to Maybe.
template <typename T>
-void PrintTo(const Maybe<T>& value, std::ostream* out) {
+void PrintTo(const std::optional<T>& value, std::ostream* out) {
if (value) {
*out << ::testing::PrintToString(value.value());
} else {