switch to -std=c++11

This commit is contained in:
Joe Thornber 2013-05-14 15:37:57 +01:00
parent 730a82f974
commit 224ef1f429
4 changed files with 8 additions and 10 deletions

View File

@ -74,7 +74,7 @@ CXX:=@CXX@
OBJECTS:=$(subst .cc,.o,$(SOURCE))
TOP_DIR:=@top_srcdir@
TOP_BUILDDIR:=@top_builddir@
CXXFLAGS+=-g -Wall -fno-strict-aliasing
CXXFLAGS+=-std=c++11 -g -Wall -fno-strict-aliasing
CXXFLAGS+=@CXXOPTIMISE_FLAG@
CXXFLAGS+=@CXXDEBUG_FLAG@
INCLUDES+=-I$(TOP_BUILDDIR) -I$(TOP_DIR) -I$(TOP_DIR)/thin-provisioning

View File

@ -24,7 +24,7 @@
namespace {
class sm_careful_alloc : public checked_space_map {
public:
typedef shared_ptr<sm_careful_alloc> ptr;
typedef std::shared_ptr<sm_careful_alloc> ptr;
sm_careful_alloc(checked_space_map::ptr sm)
: sm_(sm) {

View File

@ -32,7 +32,7 @@ using namespace testing;
namespace {
block_address const NR_BLOCKS = 102400;
typedef array<uint64_traits> array64;
typedef persistent_data::array<uint64_traits> array64;
transaction_manager::ptr
create_tm() {
@ -67,14 +67,14 @@ namespace {
TEST(ArrayTests, can_create_an_empty_array)
{
array<uint64_traits>::ptr tree = create_array(0, 0);
persistent_data::array<uint64_traits>::ptr tree = create_array(0, 0);
ASSERT_THROW(tree->get(0), runtime_error);
}
TEST(ArrayTests, get_elements)
{
unsigned const COUNT = 10000;
array<uint64_traits>::ptr tree = create_array(COUNT, 123);
persistent_data::array<uint64_traits>::ptr tree = create_array(COUNT, 123);
for (unsigned i = 0; i < COUNT; i++)
ASSERT_THAT(tree->get(i), Eq(123u));
@ -85,7 +85,7 @@ TEST(ArrayTests, get_elements)
TEST(ArrayTests, set_elements)
{
unsigned const COUNT = 10000;
array<uint64_traits>::ptr tree = create_array(COUNT, 123);
persistent_data::array<uint64_traits>::ptr tree = create_array(COUNT, 123);
for (unsigned i = 0; i < COUNT; i++)
tree->set(i, 124);
@ -117,7 +117,7 @@ TEST(ArrayTests, grow)
chunks.push_back(c);
chunks.push_back(COUNT);
array<uint64_traits>::ptr a = create_array(0, 123);
persistent_data::array<uint64_traits>::ptr a = create_array(0, 123);
for (unsigned i = 1; i < chunks.size(); i++) {
if (i > 1)

View File

@ -19,8 +19,6 @@
#include "gmock/gmock.h"
#include "persistent-data/cache.h"
#include <boost/shared_ptr.hpp>
using namespace boost;
using namespace base;
using namespace std;
@ -55,7 +53,7 @@ namespace {
struct SharedThingTraits {
typedef unsigned key_type;
typedef shared_ptr<Thing> value_type;
typedef std::shared_ptr<Thing> value_type;
static key_type get_key(value_type const &p) {
return p->key_;