summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2019-02-11 15:27:50 +0000
committerMonty Taylor <mordred@inaugust.com>2019-02-11 15:27:50 +0000
commit5a36c4a3ebbc99d102d396906aae4e3caaec9ad2 (patch)
tree31aab3524a0e641c1003dc7789dc7f89e4cdf4d7
parentaa1cd8ed1c272bf59e0a4f47e0c3f96493fd1d38 (diff)
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.
-rw-r--r--m4/opendev_canonical.m42
-rw-r--r--zuul-preview/main.cc3
2 files changed, 3 insertions, 2 deletions
diff --git a/m4/opendev_canonical.m4 b/m4/opendev_canonical.m4
index fe09120..9dccd1e 100644
--- a/m4/opendev_canonical.m4
+++ b/m4/opendev_canonical.m4
@@ -20,7 +20,7 @@ AC_DEFUN([OPENDEV_CANONICAL_TARGET],[
20 AX_IS_RELEASE(always) 20 AX_IS_RELEASE(always)
21 AM_SILENT_RULES([yes]) 21 AM_SILENT_RULES([yes])
22 22
23 AX_CXX_COMPILE_STDCXX([17],[],[mandatory]) 23 AX_CXX_COMPILE_STDCXX([14],[],[mandatory])
24 AM_PROG_CC_C_O 24 AM_PROG_CC_C_O
25 AC_PROG_CC_STDC 25 AC_PROG_CC_STDC
26 gl_VISIBILITY 26 gl_VISIBILITY
diff --git a/zuul-preview/main.cc b/zuul-preview/main.cc
index d2dc717..42f479d 100644
--- a/zuul-preview/main.cc
+++ b/zuul-preview/main.cc
@@ -19,6 +19,7 @@
19 19
20#include <config.h> 20#include <config.h>
21#include <pthread.h> 21#include <pthread.h>
22#include <boost/optional.hpp>
22#include <cpprest/http_client.h> 23#include <cpprest/http_client.h>
23#include <bits/stdc++.h> 24#include <bits/stdc++.h>
24 25
@@ -54,7 +55,7 @@ public:
54 55
55 // Lookup the hostname in the cache and return the URL if present. 56 // Lookup the hostname in the cache and return the URL if present.
56 // If the entry is present, it is moved to the head of the queue. 57 // If the entry is present, it is moved to the head of the queue.
57 optional<const string> get(const string &key) 58 boost::optional<const string> get(const string &key)
58 { 59 {
59 auto location = map.find(key); 60 auto location = map.find(key);
60 if (location == map.end()) 61 if (location == map.end())