From 5a36c4a3ebbc99d102d396906aae4e3caaec9ad2 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Mon, 11 Feb 2019 15:27:50 +0000 Subject: [PATCH] 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. --- m4/opendev_canonical.m4 | 2 +- zuul-preview/main.cc | 3 ++- 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],[ AX_IS_RELEASE(always) AM_SILENT_RULES([yes]) - AX_CXX_COMPILE_STDCXX([17],[],[mandatory]) + AX_CXX_COMPILE_STDCXX([14],[],[mandatory]) AM_PROG_CC_C_O AC_PROG_CC_STDC 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 @@ #include #include +#include #include #include @@ -54,7 +55,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. - optional get(const string &key) + boost::optional get(const string &key) { auto location = map.find(key); if (location == map.end())