From 0a58af807b482dac3f02d1c9bc9a74bec863cd8b Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Tue, 19 May 2020 16:42:52 -0500 Subject: [PATCH] Bump to c++17 and switch boost::optional to std::optional We have access to c++17, so use it. As a result, replace boost::optional with std::optional. Change-Id: Iba59bfd516264e817f2da14ded47d4d63a37e399 --- Makefile | 2 +- main.cc | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 4c697b2..3644e74 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ BUILDTYPE ?= Release PREFIX := /usr/local LDFLAGS := -lssl -lcrypto -lboost_system -lcpprest -pthread WARNING_FLAGS := -pedantic -Werror -Wall -Wextra -Weffc++ -Wundef -Wshadow -Wstrict-aliasing -Wswitch-enum -Wformat=2 -Wattributes -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wold-style-cast -Wconversion -Wframe-larger-than=32768 -Wredundant-decls -COMMON_FLAGS := -g -pthread -std=gnu++14 -fdiagnostics-show-option -fdiagnostics-generate-patch +COMMON_FLAGS := -g -pthread -std=gnu++17 -fdiagnostics-show-option -fdiagnostics-generate-patch RELEASE_FLAGS := -O2 -DNDEBUG DEBUG_FLAGS := -O0 -DDEBUG -fno-inline-functions -fno-omit-frame-pointer diff --git a/main.cc b/main.cc index 81a9c0c..85be1a8 100644 --- a/main.cc +++ b/main.cc @@ -24,7 +24,6 @@ */ #include -#include #include #include @@ -61,7 +60,7 @@ public: // Lookup the hostname in the cache and return the URL if present. // If the entry is present, it is moved to the head of the queue. - boost::optional get(const string &key) + std::optional get(const string &key) { auto location = map.find(key); if (location == map.end())