build: switch to C++14
Change-Id: I7a32dad01e74ef5b7c5f37a5464d0b17a7882c61
Refs: #3076
diff --git a/.waf-tools/default-compiler-flags.py b/.waf-tools/default-compiler-flags.py
index e9fdcc6..e690290 100644
--- a/.waf-tools/default-compiler-flags.py
+++ b/.waf-tools/default-compiler-flags.py
@@ -39,7 +39,7 @@
conf.areCustomCxxflagsPresent = (len(conf.env.CXXFLAGS) > 0)
- # General flags are always applied (e.g., selecting C++11 mode)
+ # General flags are always applied (e.g., selecting C++ language standard)
generalFlags = conf.flags.getGeneralFlags(conf)
conf.add_supported_cxxflags(generalFlags['CXXFLAGS'])
conf.add_supported_linkflags(generalFlags['LINKFLAGS'])
@@ -128,7 +128,7 @@
"""
def getGeneralFlags(self, conf):
flags = super(GccBasicFlags, self).getGeneralFlags(conf)
- flags['CXXFLAGS'] += ['-std=c++11']
+ flags['CXXFLAGS'] += ['-std=c++14']
return flags
def getDebugFlags(self, conf):
diff --git a/core/common.hpp b/core/common.hpp
index 156d59d..b0fc450 100644
--- a/core/common.hpp
+++ b/core/common.hpp
@@ -46,10 +46,10 @@
#include <cstdint>
#include <functional>
#include <limits>
-#include <list>
#include <map>
#include <memory>
#include <set>
+#include <stdexcept>
#include <string>
#include <unordered_map>
#include <unordered_set>
@@ -84,8 +84,7 @@
using std::unique_ptr;
using std::weak_ptr;
using std::make_shared;
-using ndn::make_unique;
-using std::enable_shared_from_this;
+using std::make_unique;
using std::static_pointer_cast;
using std::dynamic_pointer_cast;
diff --git a/daemon/face/face.hpp b/daemon/face/face.hpp
index 4a97b3f..a81a75e 100644
--- a/daemon/face/face.hpp
+++ b/daemon/face/face.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, Regents of the University of California,
+ * Copyright (c) 2014-2018, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -68,7 +68,7 @@
#ifndef WITH_TESTS
final
#endif
- : public enable_shared_from_this<Face>, noncopyable
+ : public std::enable_shared_from_this<Face>, noncopyable
{
public:
Face(unique_ptr<LinkService> service, unique_ptr<Transport> transport);
diff --git a/daemon/fw/access-strategy.hpp b/daemon/fw/access-strategy.hpp
index 4374fa2..cdb55e2 100644
--- a/daemon/fw/access-strategy.hpp
+++ b/daemon/fw/access-strategy.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,10 +27,8 @@
#define NFD_DAEMON_FW_ACCESS_STRATEGY_HPP
#include "strategy.hpp"
-#include "core/rtt-estimator.hpp"
#include "retx-suppression-fixed.hpp"
-#include <unordered_set>
-#include <unordered_map>
+#include "core/rtt-estimator.hpp"
namespace nfd {
namespace fw {
diff --git a/daemon/mgmt/command-authenticator.hpp b/daemon/mgmt/command-authenticator.hpp
index 114dcd3..5589187 100644
--- a/daemon/mgmt/command-authenticator.hpp
+++ b/daemon/mgmt/command-authenticator.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,6 +27,7 @@
#define NFD_DAEMON_MGMT_COMMAND_AUTHENTICATOR_HPP
#include "core/config-file.hpp"
+
#include <ndn-cxx/mgmt/dispatcher.hpp>
namespace ndn {
@@ -39,9 +40,9 @@
namespace nfd {
-/** \brief provides ControlCommand authorization according to NFD configuration file
+/** \brief Provides ControlCommand authorization according to NFD configuration file.
*/
-class CommandAuthenticator : public enable_shared_from_this<CommandAuthenticator>, noncopyable
+class CommandAuthenticator : public std::enable_shared_from_this<CommandAuthenticator>, noncopyable
{
public:
static shared_ptr<CommandAuthenticator>
diff --git a/daemon/table/cs-policy-priority-fifo.hpp b/daemon/table/cs-policy-priority-fifo.hpp
index 4ac5a63..a914891 100644
--- a/daemon/table/cs-policy-priority-fifo.hpp
+++ b/daemon/table/cs-policy-priority-fifo.hpp
@@ -29,6 +29,8 @@
#include "cs-policy.hpp"
#include "core/scheduler.hpp"
+#include <list>
+
namespace nfd {
namespace cs {
namespace priority_fifo {
diff --git a/daemon/table/pit-entry.hpp b/daemon/table/pit-entry.hpp
index c0fee00..2e49824 100644
--- a/daemon/table/pit-entry.hpp
+++ b/daemon/table/pit-entry.hpp
@@ -30,6 +30,8 @@
#include "pit-out-record.hpp"
#include "core/scheduler.hpp"
+#include <list>
+
namespace nfd {
namespace name_tree {
diff --git a/rib/rib-entry.hpp b/rib/rib-entry.hpp
index bdc858b..161ebd4 100644
--- a/rib/rib-entry.hpp
+++ b/rib/rib-entry.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,12 +28,14 @@
#include "route.hpp"
+#include <list>
+
namespace nfd {
namespace rib {
-/** \brief represents a RIB entry, which contains one or more Routes with the same prefix
+/** \brief Represents a RIB entry, which contains one or more Routes with the same prefix.
*/
-class RibEntry : public enable_shared_from_this<RibEntry>
+class RibEntry : public std::enable_shared_from_this<RibEntry>
{
public:
typedef std::list<Route> RouteList;
diff --git a/rib/rib-update-batch.hpp b/rib/rib-update-batch.hpp
index e8d6324..12636a8 100644
--- a/rib/rib-update-batch.hpp
+++ b/rib/rib-update-batch.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,15 +26,16 @@
#ifndef NFD_RIB_RIB_UPDATE_BATCH_HPP
#define NFD_RIB_RIB_UPDATE_BATCH_HPP
-#include "core/common.hpp"
#include "rib-update.hpp"
+#include <list>
+
namespace nfd {
namespace rib {
typedef std::list<RibUpdate> RibUpdateList;
-/** \brief represents a collection of RibUpdates to be applied to a single FaceId
+/** \brief Represents a collection of RibUpdates to be applied to a single FaceId.
*/
class RibUpdateBatch
{
diff --git a/tests/daemon/face/lp-reliability.t.cpp b/tests/daemon/face/lp-reliability.t.cpp
index 1c937ac..ddd1e33 100644
--- a/tests/daemon/face/lp-reliability.t.cpp
+++ b/tests/daemon/face/lp-reliability.t.cpp
@@ -32,7 +32,6 @@
#include "dummy-transport.hpp"
#include <cstring>
-#include <unordered_set>
namespace nfd {
namespace face {