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
This commit is contained in:
Monty Taylor 2020-05-19 16:42:52 -05:00
parent f19e38dab5
commit 0a58af807b
2 changed files with 2 additions and 3 deletions

View File

@ -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

View File

@ -24,7 +24,6 @@
*/
#include <pthread.h>
#include <boost/optional.hpp>
#include <cpprest/http_client.h>
#include <bits/stdc++.h>
@ -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<const string> get(const string &key)
std::optional<const string> get(const string &key)
{
auto location = map.find(key);
if (location == map.end())