Skip to content

Commit 8f0efc4

Browse files
committed
Use std=c++11
For better compatibility
1 parent 2fc4698 commit 8f0efc4

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

core/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ else ifeq ($(words $(MAKECMDGOALS)),1)
4545
endif
4646

4747
CXXARCHFLAGS ?= -march=native
48-
CXXFLAGS += -std=gnu++11 -g3 -ggdb3 $(CXXARCHFLAGS) \
48+
CXXFLAGS += -std=c++11 -g3 -ggdb3 $(CXXARCHFLAGS) \
4949
-Werror -isystem $(DPDK_INC_DIR) -isystem . -D_GNU_SOURCE \
5050
-Wall -Wextra -Wcast-align
5151

core/utils/cuckoo_map.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <functional>
1313
#include <limits>
1414
#include <stack>
15+
#include <type_traits>
1516
#include <utility>
1617
#include <vector>
1718

@@ -180,7 +181,9 @@ class CuckooMap {
180181
Entry* Find(const K& key, const H& hasher = H(), const E& eq = E()) {
181182
// Blame Effective C++ for this
182183
return const_cast<Entry*>(
183-
static_cast<const typeof(*this)&>(*this).Find(key, hasher, eq));
184+
static_cast<
185+
const typename std::remove_reference<decltype(*this)>::type&>(*this)
186+
.Find(key, hasher, eq));
184187
}
185188

186189
// const version of Find()

0 commit comments

Comments
 (0)