build: Always build in C++11 mode.

This commit also includes update of websocketpp submodule, as the
previous version has compilation problems on OSX with XCode 6.1

Change-Id: I8c9670d0026d840838d77e610e50679ee5ede7a5
Refs: #1930, #2082
diff --git a/.jenkins.d/10-build.sh b/.jenkins.d/10-build.sh
index b288135..37246c8 100755
--- a/.jenkins.d/10-build.sh
+++ b/.jenkins.d/10-build.sh
@@ -6,17 +6,30 @@
 git submodule sync
 git submodule update
 
-# Cleanup
-sudo ./waf distclean -j1 --color=yes
-
-# Configure
 COVERAGE=$( python -c "print '--with-coverage' if 'code-coverage' in '$JOB_NAME' else ''" )
 
-CXXFLAGS="-std=c++03 -pedantic -Wall -Wno-long-long -O2 -g -Werror" \
-  ./waf configure -j1 --color=yes --with-tests --without-pch $COVERAGE
+# Cleanup
+sudo ./waf -j1 --color=yes distclean
 
-# Build
-./waf --color=yes -j1
+# Configure/build in debug mode
+./waf -j1 --color=yes configure --with-tests --without-pch --debug
+./waf -j1 --color=yes build
+
+# Cleanup
+sudo ./waf -j1 --color=yes distclean
+
+# Configure/build in optimized mode without tests with precompiled headers
+./waf -j1 --color=yes configure
+./waf -j1 --color=yes build
+
+# Cleanup
+sudo ./waf -j1 --color=yes distclean
+
+# Configure/build in optimized mode
+./waf -j1 --color=yes configure --with-tests --without-pch $COVERAGE
+./waf -j1 --color=yes build
+
+# (tests will be run against optimized version)
 
 # Install
 sudo ./waf -j1 --color=yes install
diff --git a/.waf-tools/default-compiler-flags.py b/.waf-tools/default-compiler-flags.py
index 97921e2..31f070e 100644
--- a/.waf-tools/default-compiler-flags.py
+++ b/.waf-tools/default-compiler-flags.py
@@ -8,20 +8,14 @@
 
 def options(opt):
     opt.add_option('--debug', '--with-debug', action='store_true', default=False, dest='debug',
-                   help='''Compile in debugging mode without all optimizations (-O0)''')
-    opt.add_option('--with-c++11', action='store_true', default=False, dest='use_cxx11',
-                   help='''Enable C++11 mode (experimental, may not work)''')
+                   help='''Compile in debugging mode without optimizations (-O0 or -Og)''')
 
 def configure(conf):
     areCustomCxxflagsPresent = (len(conf.env.CXXFLAGS) > 0)
-    defaultFlags = []
-
-    if conf.options.use_cxx11:
-        defaultFlags += ['-std=c++0x', '-std=c++11']
-    else:
-        defaultFlags += ['-std=c++03', '-Wno-variadic-macros', '-Wno-c99-extensions']
-
-    defaultFlags += ['-pedantic', '-Wall', '-Wno-long-long', '-Wno-unneeded-internal-declaration']
+    defaultFlags = ['-std=c++0x', '-std=c++11',
+                    '-stdlib=libc++',   # clang on OSX < 10.9 by default uses gcc's
+                                        # libstdc++, which is not C++11 compatible
+                    '-pedantic', '-Wall']
 
     if conf.options.debug:
         conf.define('_DEBUG', 1)
@@ -32,6 +26,7 @@
                          '-fdiagnostics-color', # gcc >= 4.9
                          '-Werror',
                          '-Wno-error=maybe-uninitialized', # Bug #1560
+                         '-Wno-error=unneeded-internal-declaration', # Bug #1588
                         ]
         if areCustomCxxflagsPresent:
             missingFlags = [x for x in defaultFlags if x not in conf.env.CXXFLAGS]
@@ -46,12 +41,15 @@
         if not areCustomCxxflagsPresent:
             conf.add_supported_cxxflags(defaultFlags)
 
+    # clang on OSX < 10.9 by default uses gcc's libstdc++, which is not C++11 compatible
+    conf.add_supported_linkflags(['-stdlib=libc++'])
+
 @Configure.conf
 def add_supported_cxxflags(self, cxxflags):
     """
     Check which cxxflags are supported by compiler and add them to env.CXXFLAGS variable
     """
-    self.start_msg('Checking allowed flags for c++ compiler')
+    self.start_msg('Checking supported CXXFLAGS')
 
     supportedFlags = []
     for flag in cxxflags:
@@ -60,3 +58,18 @@
 
     self.end_msg(' '.join(supportedFlags))
     self.env.CXXFLAGS = supportedFlags + self.env.CXXFLAGS
+
+@Configure.conf
+def add_supported_linkflags(self, linkflags):
+    """
+    Check which linkflags are supported by compiler and add them to env.LINKFLAGS variable
+    """
+    self.start_msg('Checking supported LINKFLAGS')
+
+    supportedFlags = []
+    for flag in linkflags:
+        if self.check_cxx(linkflags=['-Werror', flag], mandatory=False):
+            supportedFlags += [flag]
+
+    self.end_msg(' '.join(supportedFlags))
+    self.env.LINKFLAGS = supportedFlags + self.env.LINKFLAGS
diff --git a/.waf-tools/websocket.py b/.waf-tools/websocket.py
index 77de373..c5b3384 100644
--- a/.waf-tools/websocket.py
+++ b/.waf-tools/websocket.py
@@ -71,7 +71,7 @@
             Logs.warn('    git submodule init && git submodule update')
             Logs.warn('Otherwise, manually download and extract websocketpp library:')
             Logs.warn('    mkdir websocketpp')
-            Logs.warn('    curl -L https://github.com/zaphoyd/websocketpp/tarball/e203dbed45409111c2e95cb3e4a1d178ee57d2bc > websocket.tar.gz')
+            Logs.warn('    curl -L https://github.com/zaphoyd/websocketpp/tarball/4309749dd98937b8a7be5dc0bfe679ba201c5512 > websocket.tar.gz')
             Logs.warn('    tar zxf websocket.tar.gz -C websocketpp/ --strip 1')
             Logs.warn('Alternatively, WebSocket support can be disabled with --without-websocket')
             self.fatal("The configuration failed")
diff --git a/common.hpp b/common.hpp
index cf236ca..0271006 100644
--- a/common.hpp
+++ b/common.hpp
@@ -65,17 +65,21 @@
 using boost::noncopyable;
 using boost::scoped_ptr;
 
-using ndn::shared_ptr;
-using ndn::weak_ptr;
-using ndn::enable_shared_from_this;
-using ndn::make_shared;
-using ndn::static_pointer_cast;
-using ndn::dynamic_pointer_cast;
-using ndn::const_pointer_cast;
-using ndn::function;
-using ndn::bind;
-using ndn::ref;
-using ndn::cref;
+using std::shared_ptr;
+using std::unique_ptr;
+using std::weak_ptr;
+using std::bad_weak_ptr;
+using std::make_shared;
+using std::enable_shared_from_this;
+
+using std::static_pointer_cast;
+using std::dynamic_pointer_cast;
+using std::const_pointer_cast;
+
+using std::function;
+using std::bind;
+using std::ref;
+using std::cref;
 
 using ndn::Interest;
 using ndn::Data;
diff --git a/daemon/face/face.cpp b/daemon/face/face.cpp
index f3757ff..7d3c1b7 100644
--- a/daemon/face/face.cpp
+++ b/daemon/face/face.cpp
@@ -36,10 +36,10 @@
   , m_isOnDemand(false)
   , m_isFailed(false)
 {
-  onReceiveInterest += bind(&PacketCounter::operator++, &m_counters.getNInInterests());
-  onReceiveData     += bind(&PacketCounter::operator++, &m_counters.getNInDatas());
-  onSendInterest    += bind(&PacketCounter::operator++, &m_counters.getNOutInterests());
-  onSendData        += bind(&PacketCounter::operator++, &m_counters.getNOutDatas());
+  onReceiveInterest += [this](const ndn::Interest&) { ++m_counters.getNInInterests(); };
+  onReceiveData     += [this](const ndn::Data&) {     ++m_counters.getNInDatas(); };
+  onSendInterest    += [this](const ndn::Interest&) { ++m_counters.getNOutInterests(); };
+  onSendData        += [this](const ndn::Data&) {     ++m_counters.getNOutDatas(); };
 }
 
 Face::~Face()
diff --git a/daemon/face/websocket-channel.cpp b/daemon/face/websocket-channel.cpp
index d6cf64b..a16ee64 100644
--- a/daemon/face/websocket-channel.cpp
+++ b/daemon/face/websocket-channel.cpp
@@ -115,8 +115,8 @@
       websocketpp::lib::error_code ecode;
       m_server.close(hdl, websocketpp::close::status::normal, "closed by channel", ecode);
     }
-  shared_ptr<WebSocketFace> face = make_shared<WebSocketFace>(FaceUri(remote), this->getUri(),
-                                                              hdl, ref(m_server));
+  shared_ptr<WebSocketFace> face = ndn::make_shared<WebSocketFace>(FaceUri(remote), this->getUri(),
+                                                                   hdl, ref(m_server));
   m_onFaceCreatedCallback(face);
   m_channelFaces[hdl] = face;
 
diff --git a/daemon/table/strategy-choice.cpp b/daemon/table/strategy-choice.cpp
index eedbc91..c6d45ad 100644
--- a/daemon/table/strategy-choice.cpp
+++ b/daemon/table/strategy-choice.cpp
@@ -158,7 +158,7 @@
     return shared_ptr<const Name>();
   }
 
-  return make_shared<const Name>(entry->getStrategy().getName());
+  return make_shared<Name>(entry->getStrategy().getName());
 }
 
 static inline bool
diff --git a/tests/daemon/face/tcp.cpp b/tests/daemon/face/tcp.cpp
index 7b0a77d..a87c5dc 100644
--- a/tests/daemon/face/tcp.cpp
+++ b/tests/daemon/face/tcp.cpp
@@ -234,6 +234,16 @@
     BOOST_CHECK_EQUAL(faces.size(), shouldBe);
   }
 
+  void
+  connect(const shared_ptr<TcpChannel>& channel,
+          const std::string& remoteHost,
+          const std::string& remotePort)
+  {
+    channel->connect(remoteHost, remotePort,
+                     bind(&EndToEndFixture::channel_onFaceCreated, this, _1),
+                     bind(&EndToEndFixture::channel_onConnectFailed, this, _1));
+  }
+
 public:
   LimitedIo limitedIo;
 
@@ -431,13 +441,7 @@
   BOOST_CHECK_NE(channel3, channel4);
 
   scheduler::schedule(time::seconds(1),
-      bind(&TcpChannel::connect, channel4, "127.0.0.1", "20070",
-          // does not work without static_cast
-           static_cast<TcpChannel::FaceCreatedCallback>(
-               bind(&EndToEndFixture::channel_onFaceCreated, this, _1)),
-           static_cast<TcpChannel::ConnectFailedCallback>(
-               bind(&EndToEndFixture::channel_onConnectFailed, this, _1)),
-           time::seconds(4)));
+                      bind(&EndToEndFixture::connect, this, channel4, "127.0.0.1", "20070"));
 
   scheduler::schedule(time::milliseconds(500),
                       bind(&EndToEndFixture::checkFaceList, this, 4));
diff --git a/tests/daemon/face/udp.cpp b/tests/daemon/face/udp.cpp
index 503ec74..87ee8f0 100644
--- a/tests/daemon/face/udp.cpp
+++ b/tests/daemon/face/udp.cpp
@@ -379,7 +379,7 @@
   void
   channel_onConnectFailedOk(const std::string& reason)
   {
-    //it's ok, it was supposed to fail
+    // it's ok, it was supposed to fail
     limitedIo.afterOp();
   }
 
@@ -389,6 +389,16 @@
     BOOST_CHECK_EQUAL(faces.size(), shouldBe);
   }
 
+  void
+  connect(const shared_ptr<UdpChannel>& channel,
+          const std::string& remoteHost,
+          const std::string& remotePort)
+  {
+    channel->connect(remoteHost, remotePort,
+                     bind(&EndToEndFixture::channel_onFaceCreated, this, _1),
+                     bind(&EndToEndFixture::channel_onConnectFailed, this, _1));
+  }
+
 public:
   LimitedIo limitedIo;
 
@@ -640,12 +650,7 @@
   BOOST_CHECK_NE(channel3, channel4);
 
   scheduler::schedule(time::milliseconds(500),
-           bind(&UdpChannel::connect, channel4, "127.0.0.1", "20070",
-                // does not work without static_cast
-                static_cast<UdpChannel::FaceCreatedCallback>(
-                    bind(&EndToEndFixture::channel_onFaceCreated, this, _1)),
-                static_cast<UdpChannel::ConnectFailedCallback>(
-                    bind(&EndToEndFixture::channel_onConnectFailed, this, _1))));
+                      bind(&EndToEndFixture::connect, this, channel4, "127.0.0.1", "20070"));
 
   scheduler::schedule(time::milliseconds(400), bind(&EndToEndFixture::checkFaceList, this, 2));
 
diff --git a/tests/daemon/mgmt/command-validator.cpp b/tests/daemon/mgmt/command-validator.cpp
index 5e1dd30..ac32a6e 100644
--- a/tests/daemon/mgmt/command-validator.cpp
+++ b/tests/daemon/mgmt/command-validator.cpp
@@ -230,21 +230,21 @@
   config.parse(CONFIG, false, CONFIG_PATH.native());
 
   validator.validate(*fibCommand,
-                     bind(&CommandValidatorTester::onValidated, ref(m_tester1), _1),
-                     bind(&CommandValidatorTester::onValidationFailed, ref(m_tester1), _1, _2));
+                     bind(&CommandValidatorTester::onValidated, &m_tester1, _1),
+                     bind(&CommandValidatorTester::onValidationFailed, &m_tester1, _1, _2));
 
   BOOST_REQUIRE(m_tester1.commandValidated());
   m_tester1.resetValidation();
 
   validator.validate(*statsCommand,
-                     bind(&CommandValidatorTester::onValidated, ref(m_tester1), _1),
-                     bind(&CommandValidatorTester::onValidationFailed, ref(m_tester1), _1, _2));
+                     bind(&CommandValidatorTester::onValidated, &m_tester1, _1),
+                     bind(&CommandValidatorTester::onValidationFailed, &m_tester1, _1, _2));
 
   BOOST_REQUIRE(m_tester1.commandValidated());
 
   validator.validate(*facesCommand,
-                     bind(&CommandValidatorTester::onValidated, ref(m_tester2), _1),
-                     bind(&CommandValidatorTester::onValidationFailed, ref(m_tester2), _1, _2));
+                     bind(&CommandValidatorTester::onValidated, &m_tester2, _1),
+                     bind(&CommandValidatorTester::onValidationFailed, &m_tester2, _1, _2));
 
   BOOST_REQUIRE(m_tester2.commandValidated());
   m_tester2.resetValidation();
@@ -254,8 +254,8 @@
   generator.generateWithIdentity(*unauthorizedFibCommand, m_tester2.getIdentityName());
 
   validator.validate(*unauthorizedFibCommand,
-                     bind(&CommandValidatorTester::onValidated, ref(m_tester2), _1),
-                     bind(&CommandValidatorTester::onValidationFailed, ref(m_tester2), _1, _2));
+                     bind(&CommandValidatorTester::onValidated, &m_tester2, _1),
+                     bind(&CommandValidatorTester::onValidationFailed, &m_tester2, _1, _2));
 
   BOOST_REQUIRE(m_tester2.commandValidationFailed());
 }
@@ -290,21 +290,21 @@
   config.parse(CONFIG, true, CONFIG_PATH.native());
 
   validator.validate(*fibCommand,
-                     bind(&CommandValidatorTester::onValidated, ref(m_tester1), _1),
-                     bind(&CommandValidatorTester::onValidationFailed, ref(m_tester1), _1, _2));
+                     bind(&CommandValidatorTester::onValidated, &m_tester1, _1),
+                     bind(&CommandValidatorTester::onValidationFailed, &m_tester1, _1, _2));
 
   BOOST_REQUIRE(m_tester1.commandValidationFailed());
   m_tester1.resetValidation();
 
   validator.validate(*statsCommand,
-                     bind(&CommandValidatorTester::onValidated, ref(m_tester1), _1),
-                     bind(&CommandValidatorTester::onValidationFailed, ref(m_tester1), _1, _2));
+                     bind(&CommandValidatorTester::onValidated, &m_tester1, _1),
+                     bind(&CommandValidatorTester::onValidationFailed, &m_tester1, _1, _2));
 
   BOOST_REQUIRE(m_tester1.commandValidationFailed());
 
   validator.validate(*facesCommand,
-                     bind(&CommandValidatorTester::onValidated, ref(m_tester2), _1),
-                     bind(&CommandValidatorTester::onValidationFailed, ref(m_tester2), _1, _2));
+                     bind(&CommandValidatorTester::onValidated, &m_tester2, _1),
+                     bind(&CommandValidatorTester::onValidationFailed, &m_tester2, _1, _2));
 
   BOOST_REQUIRE(m_tester2.commandValidationFailed());
   m_tester2.resetValidation();
@@ -314,8 +314,8 @@
   generator.generateWithIdentity(*unauthorizedFibCommand, m_tester2.getIdentityName());
 
   validator.validate(*unauthorizedFibCommand,
-                     bind(&CommandValidatorTester::onValidated, ref(m_tester2), _1),
-                     bind(&CommandValidatorTester::onValidationFailed, ref(m_tester2), _1, _2));
+                     bind(&CommandValidatorTester::onValidated, &m_tester2, _1),
+                     bind(&CommandValidatorTester::onValidationFailed, &m_tester2, _1, _2));
 
   BOOST_REQUIRE(m_tester2.commandValidationFailed());
 }
@@ -629,22 +629,22 @@
   config.parse(WILDCARD_CERT_CONFIG, false, CONFIG_PATH.native());
 
   validator.validate(*fibCommand,
-                     bind(&CommandValidatorTester::onValidated, ref(m_tester1), _1),
-                     bind(&CommandValidatorTester::onValidationFailed, ref(m_tester1), _1, _2));
+                     bind(&CommandValidatorTester::onValidated, &m_tester1, _1),
+                     bind(&CommandValidatorTester::onValidationFailed, &m_tester1, _1, _2));
 
   BOOST_REQUIRE(m_tester1.commandValidationFailed());
   m_tester1.resetValidation();
 
   validator.validate(*statsCommand,
-                     bind(&CommandValidatorTester::onValidated, ref(m_tester1), _1),
-                     bind(&CommandValidatorTester::onValidationFailed, ref(m_tester1), _1, _2));
+                     bind(&CommandValidatorTester::onValidated, &m_tester1, _1),
+                     bind(&CommandValidatorTester::onValidationFailed, &m_tester1, _1, _2));
 
   BOOST_REQUIRE(m_tester1.commandValidated());
   m_tester1.resetValidation();
 
   validator.validate(*facesCommand,
-                     bind(&CommandValidatorTester::onValidated, ref(m_tester1), _1),
-                     bind(&CommandValidatorTester::onValidationFailed, ref(m_tester1), _1, _2));
+                     bind(&CommandValidatorTester::onValidated, &m_tester1, _1),
+                     bind(&CommandValidatorTester::onValidationFailed, &m_tester1, _1, _2));
 
   BOOST_REQUIRE(m_tester1.commandValidated());
   m_tester1.resetValidation();
diff --git a/tests/daemon/mgmt/manager-base.cpp b/tests/daemon/mgmt/manager-base.cpp
index 58a6fd4..5d2b6c3 100644
--- a/tests/daemon/mgmt/manager-base.cpp
+++ b/tests/daemon/mgmt/manager-base.cpp
@@ -80,7 +80,7 @@
   shared_ptr<InternalFace>
   getInternalFace()
   {
-    return ndn::ptr_lib::static_pointer_cast<InternalFace>(m_face);
+    return static_pointer_cast<InternalFace>(m_face);
   }
 
   void
diff --git a/tools/ndn-autoconfig.cpp b/tools/ndn-autoconfig.cpp
index 71bca2f..87fd884 100644
--- a/tools/ndn-autoconfig.cpp
+++ b/tools/ndn-autoconfig.cpp
@@ -103,8 +103,8 @@
         finalBlockId.toSegment() > currentSegment)
       {
         m_face.expressInterest(data.getName().getPrefix(-1).appendSegment(currentSegment+1),
-                               bind(&NdnAutoconfig::fetchSegments, this, _2, buffer, onDone),
-                               bind(&NdnAutoconfig::discoverHubStage2, this, "Timeout"));
+                               ndn::bind(&NdnAutoconfig::fetchSegments, this, _2, buffer, onDone),
+                               ndn::bind(&NdnAutoconfig::discoverHubStage2, this, "Timeout"));
       }
     else
       {
@@ -122,9 +122,9 @@
     interest.setMustBeFresh(true);
 
     m_face.expressInterest(interest,
-                           bind(&NdnAutoconfig::fetchSegments, this, _2, buffer,
-                                &NdnAutoconfig::discoverHubStage1_registerHubDiscoveryPrefix),
-                           bind(&NdnAutoconfig::discoverHubStage2, this, "Timeout"));
+                           ndn::bind(&NdnAutoconfig::fetchSegments, this, _2, buffer,
+                                     &NdnAutoconfig::discoverHubStage1_registerHubDiscoveryPrefix),
+                           ndn::bind(&NdnAutoconfig::discoverHubStage2, this, "Timeout"));
   }
 
   void
diff --git a/tools/ndn-tlv-peek.cpp b/tools/ndn-tlv-peek.cpp
index dc70175..dca57e0 100644
--- a/tools/ndn-tlv-peek.cpp
+++ b/tools/ndn-tlv-peek.cpp
@@ -27,15 +27,19 @@
 
 #include "version.hpp"
 
-#include <boost/asio.hpp>
+#include <boost/noncopyable.hpp>
 
 #include <ndn-cxx/face.hpp>
 
 namespace ndntlvpeek {
 
-class NdnTlvPeek
+using ndn::_1;
+using ndn::_2;
+
+class NdnTlvPeek : boost::noncopyable
 {
 public:
+  explicit
   NdnTlvPeek(char* programName)
     : m_programName(programName)
     , m_mustBeFresh(false)
@@ -180,10 +184,8 @@
     try
       {
         m_face.expressInterest(createInterestPacket(),
-                               ndn::func_lib::bind(&NdnTlvPeek::onData,
-                                                   this, _1, _2),
-                               ndn::func_lib::bind(&NdnTlvPeek::onTimeout,
-                                                   this, _1));
+                               bind(&NdnTlvPeek::onData, this, _1, _2),
+                               bind(&NdnTlvPeek::onTimeout, this, _1));
         if (m_timeout < ndn::time::milliseconds::zero())
           {
             if (m_interestLifetime < ndn::time::milliseconds::zero())
diff --git a/tools/ndn-tlv-poke.cpp b/tools/ndn-tlv-poke.cpp
index 3f5a3b6..31ec561 100644
--- a/tools/ndn-tlv-poke.cpp
+++ b/tools/ndn-tlv-poke.cpp
@@ -27,18 +27,19 @@
 
 #include "version.hpp"
 
-#include <boost/utility.hpp>
+#include <boost/noncopyable.hpp>
 
 #include <ndn-cxx/face.hpp>
 #include <ndn-cxx/security/key-chain.hpp>
 
 namespace ndntlvpoke {
 
+using ndn::_1;
+using ndn::_2;
+
 class NdnTlvPoke : boost::noncopyable
 {
-
 public:
-
   explicit
   NdnTlvPoke(char* programName)
     : m_programName(programName)
@@ -186,11 +187,9 @@
         else
           {
             m_face.setInterestFilter(m_prefixName,
-                                     ndn::bind(&NdnTlvPoke::onInterest,
-                                               this, _1, _2, dataPacket),
+                                     bind(&NdnTlvPoke::onInterest, this, _1, _2, dataPacket),
                                      ndn::RegisterPrefixSuccessCallback(),
-                                     ndn::bind(&NdnTlvPoke::onRegisterFailed,
-                                               this, _1, _2));
+                                     bind(&NdnTlvPoke::onRegisterFailed, this, _1, _2));
           }
         if (m_timeout < ndn::time::milliseconds::zero())
           m_face.processEvents(getDefaultTimeout());
diff --git a/tools/nfdc.cpp b/tools/nfdc.cpp
index 123cdb5..4ef98bf 100644
--- a/tools/nfdc.cpp
+++ b/tools/nfdc.cpp
@@ -70,6 +70,10 @@
 
 namespace nfdc {
 
+using ndn::bind;
+using ndn::_1;
+using ndn::_2;
+
 const ndn::time::milliseconds Nfdc::DEFAULT_EXPIRATION_PERIOD = ndn::time::milliseconds::max();
 const uint64_t Nfdc::DEFAULT_COST = 0;
 
@@ -186,9 +190,11 @@
   parameters.setUri(canonicalUri.toString());
 
   m_controller.start<FaceCreateCommand>(parameters,
-                                        bind(&Nfdc::fibAddNextHop, this, _1),
+                                        [this](const ControlParameters& result) {
+                                          fibAddNextHop(result);
+                                        },
                                         bind(&Nfdc::onError, this, _1, _2,
-                                             "Face creation failed"));
+                                                  "Face creation failed"));
 }
 
 void
@@ -273,7 +279,9 @@
   parameters.setUri(canonicalUri.toString());
 
   m_controller.start<FaceCreateCommand>(parameters,
-                                        bind(&Nfdc::ribRegisterPrefix, this, _1),
+                                        [this](const ControlParameters& result) {
+                                          ribRegisterPrefix(result);
+                                        },
                                         bind(&Nfdc::onError, this, _1, _2,
                                              "Face creation failed"));
 }
@@ -389,7 +397,9 @@
   parameters.setUri(canonicalUri.toString());
 
   m_controller.start<FaceCreateCommand>(parameters,
-                                        bind(&Nfdc::faceDestroy, this, _1),
+                                        [this](const ControlParameters& result) {
+                                          faceDestroy(result);
+                                        },
                                         bind(&Nfdc::onError, this, _1, _2,
                                              "Face destroy failed"));
 }
diff --git a/websocketpp b/websocketpp
index e203dbe..4309749 160000
--- a/websocketpp
+++ b/websocketpp
@@ -1 +1 @@
-Subproject commit e203dbed45409111c2e95cb3e4a1d178ee57d2bc
+Subproject commit 4309749dd98937b8a7be5dc0bfe679ba201c5512