From 6a1a6c48f830d1b38baa16e462db1605916c5998 Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Fri, 14 Sep 2018 12:58:03 +0800 Subject: [PATCH] port back to C++11 from C++14 https://github.com/moneroexamples/onion-monero-blockchain-explorer/ issues/144 --- CMakeLists.txt | 2 +- src/MempoolStatus.cpp | 5 ++++- src/page.h | 7 ++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aa460d6..40a1800 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ set(PROJECT_NAME project(${PROJECT_NAME}) -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 11) if (WIN32) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mbig-obj -O3") diff --git a/src/MempoolStatus.cpp b/src/MempoolStatus.cpp index 151532d..2896714 100644 --- a/src/MempoolStatus.cpp +++ b/src/MempoolStatus.cpp @@ -139,10 +139,13 @@ MempoolStatus::read_mempool() mempool_size_kB += _tx_info.blob_size; - local_copy_of_mempool_txs.push_back(mempool_tx {tx_hash, tx}); + local_copy_of_mempool_txs.push_back(mempool_tx{}); mempool_tx& last_tx = local_copy_of_mempool_txs.back(); + last_tx.tx_hash = tx_hash; + last_tx.tx = tx; + // key images of inputs vector input_key_imgs; diff --git a/src/page.h b/src/page.h index 2903b0b..96d90ae 100644 --- a/src/page.h +++ b/src/page.h @@ -119,13 +119,14 @@ namespace std * visitor to produce json representations of * values stored in mstch::node */ -class mstch_node_to_json: public boost::static_visitor { +class mstch_node_to_json: public boost::static_visitor +{ public: // enabled for numeric types template - std::enable_if_t::value, nlohmann::json> + typename std::enable_if::value, nlohmann::json>::type operator()(T const& value) const { return nlohmann::json {value}; } @@ -157,7 +158,7 @@ public: // catch other types that are non-numeric and not listed above template - std::enable_if_t::value, nlohmann::json> + typename std::enable_if::value, nlohmann::json>::type operator()(const T&) const { return nlohmann::json {}; }