diff --git a/persistent-data/buffer.h b/persistent-data/buffer.h index d9a7e07..45e2390 100644 --- a/persistent-data/buffer.h +++ b/persistent-data/buffer.h @@ -44,6 +44,7 @@ namespace persistent_data { class buffer : private boost::noncopyable { public: typedef boost::shared_ptr ptr; + typedef boost::shared_ptr const_ptr; unsigned char &operator[](unsigned index) { check_index(index); diff --git a/unit-tests/buffer_t.cc b/unit-tests/buffer_t.cc index 248ad0a..69ea853 100644 --- a/unit-tests/buffer_t.cc +++ b/unit-tests/buffer_t.cc @@ -85,7 +85,7 @@ BOOST_AUTO_TEST_CASE(buffer_8_a_8_access) BOOST_AUTO_TEST_CASE(buffer_8_a_8_const_access) { uint32_t const sz = 8, align = 8; - buffer::ptr const b = create_buffer(); + buffer::const_ptr b = create_buffer(); (*b)[0] = 0; // Compile time error accessing read-only location }