Improve and simplify code with modern C++ features
Change-Id: I28d84df3087492ab2ecbeb91169a2cde12c9e31e
diff --git a/src/mgmt/nfd/controller.hpp b/src/mgmt/nfd/controller.hpp
index 6582a66..aeb4692 100644
--- a/src/mgmt/nfd/controller.hpp
+++ b/src/mgmt/nfd/controller.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).
*
@@ -74,7 +74,7 @@
start(const ControlParameters& parameters,
const CommandSucceedCallback& onSuccess,
const CommandFailCallback& onFailure,
- const CommandOptions& options = CommandOptions())
+ const CommandOptions& options = {})
{
shared_ptr<ControlCommand> command = make_shared<Command>();
this->startCommand(command, parameters, onSuccess, onFailure, options);
@@ -83,10 +83,10 @@
/** \brief start dataset fetching
*/
template<typename Dataset>
- typename std::enable_if<std::is_default_constructible<Dataset>::value>::type
+ std::enable_if_t<std::is_default_constructible<Dataset>::value>
fetch(const std::function<void(typename Dataset::ResultType)>& onSuccess,
const DatasetFailCallback& onFailure,
- const CommandOptions& options = CommandOptions())
+ const CommandOptions& options = {})
{
this->fetchDataset(make_shared<Dataset>(), onSuccess, onFailure, options);
}
@@ -98,7 +98,7 @@
fetch(const ParamType& param,
const std::function<void(typename Dataset::ResultType)>& onSuccess,
const DatasetFailCallback& onFailure,
- const CommandOptions& options = CommandOptions())
+ const CommandOptions& options = {})
{
this->fetchDataset(make_shared<Dataset>(param), onSuccess, onFailure, options);
}