buffer_t const assignment fails
This commit is contained in:
parent
5776ba114c
commit
c2ab5390cb
@ -44,6 +44,7 @@ namespace persistent_data {
|
|||||||
class buffer : private boost::noncopyable {
|
class buffer : private boost::noncopyable {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<buffer> ptr;
|
typedef boost::shared_ptr<buffer> ptr;
|
||||||
|
typedef boost::shared_ptr<buffer const> const_ptr;
|
||||||
|
|
||||||
unsigned char &operator[](unsigned index) {
|
unsigned char &operator[](unsigned index) {
|
||||||
check_index(index);
|
check_index(index);
|
||||||
|
@ -85,7 +85,7 @@ BOOST_AUTO_TEST_CASE(buffer_8_a_8_access)
|
|||||||
BOOST_AUTO_TEST_CASE(buffer_8_a_8_const_access)
|
BOOST_AUTO_TEST_CASE(buffer_8_a_8_const_access)
|
||||||
{
|
{
|
||||||
uint32_t const sz = 8, align = 8;
|
uint32_t const sz = 8, align = 8;
|
||||||
buffer<sz, align>::ptr const b = create_buffer<sz, align>();
|
buffer<sz, align>::const_ptr b = create_buffer<sz, align>();
|
||||||
|
|
||||||
(*b)[0] = 0; // Compile time error accessing read-only location
|
(*b)[0] = 0; // Compile time error accessing read-only location
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user