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:
parent
f19e38dab5
commit
0a58af807b
2
Makefile
2
Makefile
@ -3,7 +3,7 @@ BUILDTYPE ?= Release
|
|||||||
PREFIX := /usr/local
|
PREFIX := /usr/local
|
||||||
LDFLAGS := -lssl -lcrypto -lboost_system -lcpprest -pthread
|
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
|
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
|
RELEASE_FLAGS := -O2 -DNDEBUG
|
||||||
DEBUG_FLAGS := -O0 -DDEBUG -fno-inline-functions -fno-omit-frame-pointer
|
DEBUG_FLAGS := -O0 -DDEBUG -fno-inline-functions -fno-omit-frame-pointer
|
||||||
|
|
||||||
|
3
main.cc
3
main.cc
@ -24,7 +24,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <boost/optional.hpp>
|
|
||||||
#include <cpprest/http_client.h>
|
#include <cpprest/http_client.h>
|
||||||
#include <bits/stdc++.h>
|
#include <bits/stdc++.h>
|
||||||
|
|
||||||
@ -61,7 +60,7 @@ public:
|
|||||||
|
|
||||||
// Lookup the hostname in the cache and return the URL if present.
|
// 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.
|
// 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);
|
auto location = map.find(key);
|
||||||
if (location == map.end())
|
if (location == map.end())
|
||||||
|
Loading…
Reference in New Issue
Block a user