build: require gcc >= 5.3, boost >= 1.58, openssl >= 1.0.2

This effectively drops support for all versions of Ubuntu older than 16.04

Change-Id: Ie3ab7df9147e97f6467658a6399a4f9379f089c1
Refs: #4462
diff --git a/src/util/backports-optional.hpp b/src/util/backports-optional.hpp
index accae69..73e1068 100644
--- a/src/util/backports-optional.hpp
+++ b/src/util/backports-optional.hpp
@@ -107,18 +107,7 @@
 };
 constexpr nullopt_t nullopt{0};
 
-#if BOOST_VERSION >= 105600
 using boost::bad_optional_access;
-#else
-class bad_optional_access : public std::logic_error
-{
-public:
-  bad_optional_access()
-    : std::logic_error("bad optional access")
-  {
-  }
-};
-#endif
 
 template<typename T>
 constexpr bool
@@ -241,25 +230,14 @@
   T&
   value()
   {
-#if BOOST_VERSION >= 105600
     return m_boostOptional.value();
-#else
-    if (!m_boostOptional) {
-      BOOST_THROW_EXCEPTION(bad_optional_access());
-    }
-    return m_boostOptional.get();
-#endif
   }
 
   template<typename U>
   constexpr T
   value_or(U&& default_value) const
   {
-#if BOOST_VERSION >= 105600
     return m_boostOptional.value_or(default_value);
-#else
-    return m_boostOptional.get_value_or(default_value);
-#endif
   }
 
 public: // modifiers
diff --git a/src/util/regex/regex-component-matcher.cpp b/src/util/regex/regex-component-matcher.cpp
index 8d1e824..aca35c1 100644
--- a/src/util/regex/regex-component-matcher.cpp
+++ b/src/util/regex/regex-component-matcher.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -26,19 +26,6 @@
 
 namespace ndn {
 
-// Re: http://www.boost.org/users/history/version_1_56_0.html
-//
-//   Breaking change: corrected behavior of basic_regex<>::mark_count() to match existing
-//   documentation, basic_regex<>::subexpression(n) changed to match, see
-//   https://svn.boost.org/trac/boost/ticket/9227
-//
-static constexpr size_t BOOST_REGEXP_MARK_COUNT_CORRECTION =
-#if BOOST_VERSION < 105600
-    1;
-#else
-    0;
-#endif
-
 RegexComponentMatcher::RegexComponentMatcher(const std::string& expr,
                                              shared_ptr<RegexBackrefManager> backrefManager,
                                              bool isExactMatch)
@@ -56,7 +43,7 @@
   m_pseudoMatchers.clear();
   m_pseudoMatchers.push_back(make_shared<RegexPseudoMatcher>());
 
-  for (size_t i = 1; i <= m_componentRegex.mark_count() - BOOST_REGEXP_MARK_COUNT_CORRECTION; i++) {
+  for (size_t i = 1; i <= m_componentRegex.mark_count(); i++) {
     m_pseudoMatchers.push_back(make_shared<RegexPseudoMatcher>());
     m_backrefManager->pushRef(m_pseudoMatchers.back());
   }
@@ -78,7 +65,7 @@
   boost::smatch subResult;
   std::string targetStr = name.get(offset).toUri();
   if (boost::regex_match(targetStr, subResult, m_componentRegex)) {
-    for (size_t i = 1; i <= m_componentRegex.mark_count() - BOOST_REGEXP_MARK_COUNT_CORRECTION; i++) {
+    for (size_t i = 1; i <= m_componentRegex.mark_count(); i++) {
       m_pseudoMatchers[i]->resetMatchResult();
       m_pseudoMatchers[i]->setMatchResult(subResult[i]);
     }
diff --git a/src/util/scheduler-scoped-event-id.cpp b/src/util/scheduler-scoped-event-id.cpp
index f5378c8..0ca7d13 100644
--- a/src/util/scheduler-scoped-event-id.cpp
+++ b/src/util/scheduler-scoped-event-id.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2016 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -25,10 +25,8 @@
 namespace util {
 namespace scheduler {
 
-#if NDN_CXX_HAVE_IS_NOTHROW_MOVE_CONSTRUCTIBLE
 static_assert(std::is_nothrow_move_constructible<ScopedEventId>::value,
               "ScopedEventId must be MoveConstructible with noexcept");
-#endif // NDN_CXX_HAVE_IS_NOTHROW_MOVE_CONSTRUCTIBLE
 
 ScopedEventId::ScopedEventId(Scheduler& scheduler)
   : m_scheduler(&scheduler)
diff --git a/src/util/signal/scoped-connection.cpp b/src/util/signal/scoped-connection.cpp
index cbbfaba..3fed4a3 100644
--- a/src/util/signal/scoped-connection.cpp
+++ b/src/util/signal/scoped-connection.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -25,14 +25,10 @@
 namespace util {
 namespace signal {
 
-#if NDN_CXX_HAVE_IS_NOTHROW_MOVE_CONSTRUCTIBLE
 static_assert(std::is_nothrow_move_constructible<ScopedConnection>::value,
               "ScopedConnection must be MoveConstructible with noexcept");
-#endif // NDN_CXX_HAVE_IS_NOTHROW_MOVE_CONSTRUCTIBLE
 
-ScopedConnection::ScopedConnection()
-{
-}
+ScopedConnection::ScopedConnection() = default;
 
 ScopedConnection::ScopedConnection(const Connection& connection)
   : m_connection(connection)
diff --git a/src/util/signal/signal.hpp b/src/util/signal/signal.hpp
index 9b502ab..8c76e13 100644
--- a/src/util/signal/signal.hpp
+++ b/src/util/signal/signal.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -23,6 +23,7 @@
 #define NDN_UTIL_SIGNAL_SIGNAL_HPP
 
 #include "connection.hpp"
+
 #include <list>
 
 namespace ndn {
@@ -163,7 +164,7 @@
 Connection
 Signal<Owner, TArgs...>::connect(const Handler& handler)
 {
-  typename SlotList::iterator it = m_slots.insert(m_slots.end(), {handler, nullptr});
+  auto it = m_slots.insert(m_slots.end(), {handler, nullptr});
   it->disconnect = make_shared<function<void()>>(bind(&Self::disconnect, this, it));
 
   return signal::Connection(weak_ptr<function<void()>>(it->disconnect));
@@ -173,7 +174,7 @@
 Connection
 Signal<Owner, TArgs...>::connectSingleShot(const Handler& handler)
 {
-  typename SlotList::iterator it = m_slots.insert(m_slots.end(), {nullptr, nullptr});
+  auto it = m_slots.insert(m_slots.end(), {nullptr, nullptr});
   it->disconnect = make_shared<function<void()>>(bind(&Self::disconnect, this, it));
   signal::Connection conn(weak_ptr<function<void()>>(it->disconnect));
 
@@ -189,8 +190,6 @@
 void
 Signal<Owner, TArgs...>::disconnect(typename SlotList::iterator it)
 {
-  // 'it' could be const_iterator, but gcc 4.6 doesn't support std::list::erase(const_iterator)
-
   if (m_isExecuting) {
     // during signal emission, only the currently executing handler can be disconnected
     BOOST_ASSERT_MSG(it == m_currentSlot, "cannot disconnect another handler from a handler");
diff --git a/src/util/time.hpp b/src/util/time.hpp
index cf497af..0d1250d 100644
--- a/src/util/time.hpp
+++ b/src/util/time.hpp
@@ -303,7 +303,7 @@
  * \param format desired output format (default: `%Y-%m-%d %H:%M:%S`)
  * \param locale desired locale (default: "C" locale)
  *
- * \sa http://www.boost.org/doc/libs/1_54_0/doc/html/date_time/date_time_io.html#date_time.format_flags
+ * \sa https://www.boost.org/doc/libs/1_58_0/doc/html/date_time/date_time_io.html#date_time.format_flags
  *     describes possible formatting flags
  **/
 std::string
@@ -321,7 +321,7 @@
  * \param format input output format (default: `%Y-%m-%d %H:%M:%S`)
  * \param locale input locale (default: "C" locale)
  *
- * \sa http://www.boost.org/doc/libs/1_54_0/doc/html/date_time/date_time_io.html#date_time.format_flags
+ * \sa https://www.boost.org/doc/libs/1_58_0/doc/html/date_time/date_time_io.html#date_time.format_flags
  *     describes possible formatting flags
  */
 system_clock::TimePoint