Use boost::optional and drop std back to 14
boost::optional works on stretch and doesn't add any depends. The c++17 support in gcc isn't complete anyway.
This commit is contained in:
parent
aa1cd8ed1c
commit
5a36c4a3eb
@ -20,7 +20,7 @@ AC_DEFUN([OPENDEV_CANONICAL_TARGET],[
|
|||||||
AX_IS_RELEASE(always)
|
AX_IS_RELEASE(always)
|
||||||
AM_SILENT_RULES([yes])
|
AM_SILENT_RULES([yes])
|
||||||
|
|
||||||
AX_CXX_COMPILE_STDCXX([17],[],[mandatory])
|
AX_CXX_COMPILE_STDCXX([14],[],[mandatory])
|
||||||
AM_PROG_CC_C_O
|
AM_PROG_CC_C_O
|
||||||
AC_PROG_CC_STDC
|
AC_PROG_CC_STDC
|
||||||
gl_VISIBILITY
|
gl_VISIBILITY
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#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>
|
||||||
|
|
||||||
@ -54,7 +55,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.
|
||||||
optional<const string> get(const string &key)
|
boost::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…
x
Reference in New Issue
Block a user