Browse Source

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.
changes/91/636791/1
Monty Taylor 3 months ago
parent
commit
5a36c4a3eb
2 changed files with 3 additions and 2 deletions
  1. 1
    1
      m4/opendev_canonical.m4
  2. 2
    1
      zuul-preview/main.cc

+ 1
- 1
m4/opendev_canonical.m4 View File

@@ -20,7 +20,7 @@ AC_DEFUN([OPENDEV_CANONICAL_TARGET],[
20 20
   AX_IS_RELEASE(always)
21 21
   AM_SILENT_RULES([yes])
22 22
 
23
-  AX_CXX_COMPILE_STDCXX([17],[],[mandatory])
23
+  AX_CXX_COMPILE_STDCXX([14],[],[mandatory])
24 24
   AM_PROG_CC_C_O
25 25
   AC_PROG_CC_STDC
26 26
   gl_VISIBILITY

+ 2
- 1
zuul-preview/main.cc View File

@@ -19,6 +19,7 @@
19 19
 
20 20
 #include <config.h>
21 21
 #include <pthread.h>
22
+#include <boost/optional.hpp>
22 23
 #include <cpprest/http_client.h>
23 24
 #include <bits/stdc++.h>
24 25
 
@@ -54,7 +55,7 @@ public:
54 55
 
55 56
   // Lookup the hostname in the cache and return the URL if present.
56 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 60
     auto location = map.find(key);
60 61
     if (location == map.end())

Loading…
Cancel
Save